Last active
August 29, 2015 14:15
-
-
Save z-------------/5adfab3a9d05a8f8b2ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rand_item(my_list): | |
return(my_list[round(random.random() * (len(my_list) - 1))]) | |
''' | |
use it like so: | |
waffles_list = ["waffles", "are", "cool"] | |
random_word = rand_item(waffles_list) | |
(don't forget to import random) | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment