#!/usr/bin/python # -*- coding=utf-8 -*- import random
tnum = random.randint(0,100) # generate a random int type number print('Guess what number I\'m thinking' )
n = int(input('plz input your answer:')) # get input while n != tnum: if n > tnum: print('too large') else: print('too small')
n = int(input('plz input your answer:'))
if n == tnum: print('you get it,congratulations!')
#!/usr/bin/python # -*- coding=utf-8 -*- import random
tnum = random.randint(0,100) # generate a random int type number print('Guess what number I\'m thinking' )
n = int(input('plz input your answer:')) # get input while True: if n > tnum: print('too large')
n = int(input('plz input your answer:')) elif n < tnum: print('too small')
n = int(input('plz input your answer:')) else: print('you get it,congratulations!') break