public
Created

Challenge #1 [difficult]

  • Download Gist
gistfile1.py
Python
1 2 3 4 5 6 7 8
from random import *
min, max, result = 1, 100, ''
while result != 'y':
guess = randint(min, max)
result = raw_input('Is your number {}? (Y|H|L) '.format(guess)).lower()[0]
if result == 'h': max = guess
elif result == 'l': min = guess
print "Your number is {}.".format(guess)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.