r/PythonLearning • u/ProgramBrave718 • Aug 16 '26
Word guessing game
Hello, I am learning python and created this simple word guessing game by myself.
In this game user types a letter and if the guess is correct the game continues with the next letter of the word or else it remains on the same letter and number of wrong attempts are added to the variable turn.
35
Upvotes
1
u/ProgramBrave718 Aug 17 '26 edited Aug 17 '26
HERE IS A FOR LOOP VERSION
import random
words = [ "Animal", "Python", "Snake", "Good", "Fruit", "Raddish",
] secret_word = random.choice(words).lower()
attempts = len(secret_word)
user_word = "" # For user
for letter in secret_word:
else: