Colleague: “No, you cannot do functional programming in Python!”
Me: “Hold my pretzel.”
multiinsertL = (lambda list, new, old:
[] if not list
else [new, old, *multiinsertL(list[1:], new, old)] if list[0] == old
else [list[0], *multiinsertL(list[1:], new, old)])
You must be logged in to post a comment.