Creating a guess a word game and secret_word can be in any variation but how would I write different variation of secret_word is recognized by the program?
In this case, secret word is "Korea", how am I able to unify any variation or do I have to insert every different kind of variation?
secret_word = {"korea", "kOrea", "KoRea", "KoReA", "KOrea", "KORea", "Korea", "KOREA"}
guess = ""
guess_count = 0
guess_limit = 3
out_of_guesses = False
while guess != secret_word and not (out_of_guesses):
if guess_count < guess_limit:
guess = input("Guess a word: ")
guess_count += 1
else:
out_of_guesses = True
if out_of_guesses:
print("Maybe Next time! You are out of guesses")
else:
print("You win!")