Advertisement
mejpark

Python guessing game (v3)

Oct 22nd, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. # Version 3: http://pastebin.com/FK8c83Te
  2.  
  3. print("Welcome!")
  4.  
  5. guess = 0
  6.  
  7. while guess != 5:
  8.  
  9.         g = input("Guess the number: ")
  10.    
  11.         guess = int(g)
  12.  
  13.         if guess == 5:
  14.  
  15.                 print("You win!")
  16.  
  17.         elif guess > 5:
  18.  
  19.                 print("Too high")
  20.  
  21.         else:
  22.                 print("Too low")
  23.              
  24. print("Game over!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement