from random import choice, sample words = ('apple', 'answer', 'juniper', 'question', 'tea', 'sea') print() print("Find jumbled words! (Ctrl+C to exit)") print() while True: the_word = choice(words).upper() shuffled = the_word while shuffled == the_word: shuffled = ''.join(sample(shuffled, len(shuffled))) print() print("Find the jumbled word of", shuffled, "!") player_input = input("Your quess: ") if player_input.upper() == the_word: print("Yes!") else: print("No.") print("It was", the_word)
Source code of Jumbled word (word_jumble.py).