Advertisement
IT45200

Untitled

May 29th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. secret_word = "book"
  2. guess = ""
  3. number_of_gueses = 0
  4. gues_limit = 3
  5. out_of_guese = False
  6. guess = input("guess a word : ")
  7. number_of_gueses += 1
  8. while guess != secret_word and not out_of_guese:
  9.     if number_of_gueses<gues_limit:
  10.         guess=input("wrong guess try again : ")
  11.         number_of_gueses += 1
  12.     else:
  13.         out_of_guese=True
  14.  
  15. if out_of_guese:
  16.     print("you lose!")
  17. else:
  18.     print("You Win!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement