Advertisement
mercode

Guess game

Jan 19th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. print("*"*100)
  2. print(" " *35, "This is a simple guess game")
  3. print(" " *33, "I guessed a number between 0-10")
  4. print("*"*100)
  5. guess_szam =6
  6. max_life=3
  7. jatekos_szam = int(input('What is my number'))
  8. while not guess_szam == jatekos_szam:
  9.     max_life -=1
  10.     if max_life == 0:
  11.         break
  12.     print ("wrong...")
  13.     print (f"You have {max_life} left..")
  14.     jatekos_szam = int(input('What is my number'))
  15. if jatekos_szam == guess_szam:
  16.     print(f"That's it! {jatekos_szam} was my number!!")
  17.     print ("End")
  18. else:
  19.     print("Vesztettél!!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement