Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # random_words.py
- # Random Words
- #
- # Computer prints a list of words in random order, not repeating any
- #
- # Heidi Heffelfinger
- # November 1, 2012
- # Programming Python for the Absolute Beginner 3rd Ed. Chapter 5
- # Challenge 1
- # import modules
- import random
- # create list
- word_list = ["bunny", "rabbit", "hare", "buck", "coney",
- "cottontail", "cuniculus", "doe", "lagomorph", "lapin"]
- while word_list != []:
- word = random.choice(word_list)
- print(word)
- word_list.remove(word)
- input("\n\nPress the enter key to exit.")
Advertisement
Add Comment
Please, Sign In to add comment