Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Roll a die, defaulting to d6
import random
def roll(d=6):
return random.randint(1, d)
# Randomly select a value a list
import random
wordlist = ['quick', 'brown', 'fox', 'jumped']
# To randomly sort a list:
import random
mystr = ['a','b','c','d','e','f','g','h']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment