Skip to content

Instantly share code, notes, and snippets.

@smac89
Last active May 20, 2016 23:00
Show Gist options
  • Save smac89/d06b1b5d778a7b6c91f887d1bc72e789 to your computer and use it in GitHub Desktop.
Save smac89/d06b1b5d778a7b6c91f887d1bc72e789 to your computer and use it in GitHub Desktop.
Version of python's string join which allows for random seperators
import random
def join_rand(words, *sep):
return reduce(lambda joined, new: random.choice(sep).join((joined, new)), words)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment