import random a=random.randint(1,20) print 'please guess 1-20' for g in range(1,7): print 'please write a number' guess=int(input()) if guess>a: print 'your guess is too big' elif guess<a: print 'your guess is too low' else: print 'your guess num is '+str(a) break