猫史档案馆


【Python作品分享】猜数【作品秀】

用户:_Rise__Rise_查看:1 回复:6 评论:1 创建时间:2020-05-04T22:28:16


【作品展示】

center_image

 

【作品介绍】

就是个猜数

 

【作品源代码】

import random
import time


a = random.randint(1, 10000)
for __count in range(10000):
    b = int(input('猜数'))
    if (a == b):
        print('恭喜你,猜对了')
        break
    elif (a > b):
        print('你猜小了,加油哦')
        time.sleep(0.2)
    else:
        print('你猜大了,加油哦')
        time.sleep(0.2)

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
_Rise__Rise_

点赞0


评论


_Rise__Rise_

dd

点赞0


评论


_Rise__Rise_

顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶

点赞0


评论


LAG的1048576一枚LAG的1048576一枚

积木!

点赞0


评论


無一郎無一郎

打个广告https://shequ.codemao.cn/community/289455

点赞0


评论


不起眼的账号不起眼的账号

为什么不用while循环呢?

点赞0


评论