ubuntu随机测试

前端之家收集整理的这篇文章主要介绍了ubuntu随机测试前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
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

猜你在找的Ubuntu相关文章