# Guess My Number GAME # Program by DARE, Adewole import random def instructions(): print \ """ In This FUN game, you will have to choose a number that the computer picks. If your guess is Higher than the computers', you will be informed, the same goes for a lower guess. GOODLUCK!!! """ def main(): magic_number = random.randrange(100) + 1 guess = None while guess != magic_number: response = raw_input("Enter your Guess: ") if guess > magic_number: print "Guess is Higher! Please Guess Lower!" elif guess < magic_number: print "That Guess is Lower! Try one Higher" print "Nice, you were %s, the number is %s" % ("correct", magic_number) instructions() main() raw_input("Press the <ENTER> Key to Exit!")
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question