'Repeat a game over and over when player is asked
import random
list1=["lweot","rkow","ewyighetav"]
word_chose=random.choice(list1)
print("Hello and welcome to the anagram game ! Your word is {}".format(word_chose))
player_guess=input("Please type your guess : ").lower
def finding_word():
game=True
while game:
if player_guess == "towel" or "heavyweight" or "work":
print("Good job")
elif player_guess != "towel" or "heavyweight" or "work":
print("try again")
play_again=input("Do you want to play this game again ? y/n : ").lower()
if play_again == "yes":
finding_word()
else:
print("Bye")
finding_word()
"""Hello I tried this method to repeat this game and is not working .it keeps looping over and over. I tried this method on another project and it worked. Thank you"""
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
