用户:
021林查看:0 回复:1 评论:0 创建时间:2021-05-19T20:02:53
【作品展示】

【作品介绍】
有一个数字被控制台挡了
【作品源代码】
import random
A=random.randint(1,10)
B=random.randint(1,10)
A>B
C=A-B
input(A-B)
if input == C:
print('yes!')
else:
print('no')
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn有点语法和逻辑错误,给你顺便改了
import random
A=0
B=0
#循环生成数据
while True:
A = random.randint(1,10)
B = random.randint(1,10)
if A > B:
break
C=A-B
R = int(input("A-B=? "))
if R == C:
print('yes!')
else:
print('no')点赞0
评论