Advertisement
GameNationRDF

Number Guessin' Game in Python!

Sep 2nd, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. #Number Guessing Game in Python!..
  2. #Code by GameNationRDF..
  3. #You can easily change the game's number range!..
  4.  
  5. from random import uniform
  6. import math
  7. while True:
  8.     ai_choice_raw = uniform(0, 10)
  9.     ai_choice = math.floor(ai_choice_raw)
  10.     print ("Pick yo number! (Between 0 and 10)")
  11.     user_number=int(input("> "))
  12.     if (user_number)>10:
  13.         break
  14.     elif (user_number)==(ai_choice):
  15.         print ("Computer guessed it right!")
  16.     elif (user_number)!=(ai_choice):
  17.         print ("Guesses did not match! :(")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement