用户:
Python-happyyyy查看:0 回复:1 评论:0 创建时间:2020-08-13T13:39:27
【作品展示】

【作品介绍】
酷土豆
【作品源代码】
import time
import random
import turtle
__Pen = turtle.Pen()
print('hello,我们来玩猜垃圾的游戏吧,(写1 2 3 4)(1是有害,2是可回收,3是厨余,4是其他)')
答对 = 0
time.sleep(2)
for __count in range(12):
e = 0
a = ['锂电池', '过期药物', '废弃灯管']
b = ['纸', '报纸']
c = ['剩菜', '剩饭', '小骨头', '蛋壳']
d = ['大棒骨', '渣土', '污染的纸']
time.sleep(2)
垃圾1 = random.choice(['锂电池', '过期药物', '废弃灯管', '纸', '报纸', '剩菜', '剩饭', '小骨头', '蛋壳', '大棒骨', '渣土', '污染的纸'])
if (垃圾1 in a):
垃圾 = 1
elif (垃圾1 in b):
垃圾 = 2
elif (垃圾1 in c):
垃圾 = 3
else:
if (垃圾1 in d):
垃圾 = 4
e = turtle.numinput(垃圾1, '是什么垃圾?')
if (垃圾 == e):
print('对')
答对 += 1
else:
print('错')
print('你答对了', 答对, '题')
if (答对 == 12):
print('可以啊~~可以,都对了')
elif (答对 <= 5):
print('你是不是就没好好答')
else:
print('再接再厉')
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn