import random #Create a list guesslist = ['grape', 'orange', 'chloroplast', 'ribosome', 'lipstick'] chance = 3 score = 0 print (guesslist) while chance != 0: random_item = random.choice(guesslist) user_input = input("Please guess a word: ") if user_input == random_item: print ("That's correct!") score = score + 100 print ("Score:", score) else: if user_input not in guesslist: print ("Sorry, that isn't even in the list!") chance = chance - 1 print ("Chance Remaining:", chance) else: print ("Sorry, wrong choice!") chance = chance - 1 print ("Chance Remaining:", chance) if chance == 0: print ("The word was", random_item) print ("The score is", score) |
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment