Create a gist now

Instantly share code, notes, and snippets.

Challenge #1 [difficult]
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment