成都网站建设设计

将想法与焦点和您一起共享

python基础之猜数字游戏

import random
random_num = random.randint(0,100)
print('this number is:', random_num)
count = 0
while count < 5:
    count += 1
    number = int(input('please input your number:'))
    if random_num == number:
        print("congruation!you make correct!")
        break
else:
    print("你太笨了")

分享文章:python基础之猜数字游戏
新闻来源:http://chengdu.cdxwcx.cn/article/jphogc.html