SHARE
TWEET

Untitled

defbind_ Aug 18th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # guessing game
  2. secret_num = 165
  3. user_guesses = 0
  4. guess_limit = 10
  5. able_to_play = True
  6. while able_to_play and guess_limit >= user_guesses:
  7.     user_guess = int(input("Guess:  "))
  8.     if user_guess != secret_num:
  9.         if user_guess > secret_num:
  10.             print(" User guess bigger than the secret number")
  11.         else:
  12.             print(" User guess smaller than the secret number")
  13.         user_guesses += 1
  14.     else:
  15.         print("You got it rigghttt woohooo!!!")
  16.         exit("YOU WON >:)")
  17.  
  18.  
  19. else:
  20.     able_to_play = False
  21.  
  22. if able_to_play == False:
  23.     exit("you ran out of guesses")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top