Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
A little Guessing Game written in Python
SUBMITTED BY:
alemotta
DATE:
April 8, 2017, 8:09 p.m.
FORMAT:
Text only
SIZE:
480 Bytes
Raw
Download
Tweet
HITS:
526
Go to comments
Report
A little Guessing Game written in Python
import random
n = random.randint(1, 99)
guess = int(raw_input("Enter an integer from 1 to 99: "))
while n != "guess":
print
if guess < n:
print "guess is low"
guess = int(raw_input("Enter an integer from 1 to 99: "))
elif guess > n:
print "guess is high"
guess = int(raw_input("Enter an integer from 1 to 99: "))
else:
print "you guessed it!"
break
print
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus