import random
user=str(input("What's your name?"))
print("Are you ready?",user)
words=["hangman","egypt","apple","sony","tigger","spiderman","superman","sniper"]
secretkey=random.choice(words)
turns=10
print("You have turns:",turns)
guess=""
while True:
failed=0
for char in secretkey:
if char in guess:
print(char)
else:
print("_")
failed+=1
if failed==0:
print("you won")
break
guesses=str(input("Enter your guess:"))
guess+=guesses
if guesses not in secretkey:
print("Wrong")
turns-=1
print("You have turns :",turns)
if turns==0:
print("you lose")
break
ليست هناك تعليقات:
إرسال تعليق