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原文链接:https://www.f2er.com/ubuntu/355898.html