Advertisement
mejpark

Python guessing game (v2)

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