用户:
消音草查看:1 回复:2 评论:1 创建时间:2021-05-04T17:01:43
点点滴滴 导弹攻击
来,试试:
import random
import turtle
import time
def _E7_94_B5_E8_84_91_E6_80_A7_E8_83_BD_E6_B5_8B_E8_AF_95():
n = 0
s = 0
p = 0
t = 0
_E7_86_94_E5_B2_A9 = 0
for __count in range(100):
_E7_86_94_E5_B2_A9 = (_E7_86_94_E5_B2_A9 + (__count + 1))
Dict = random.randint(1, 100)
if (Dict < 25):
print('红', Dict)
t += 1
turtle.bgcolor("#ff0000")
elif (Dict >= 25 and Dict < 50):
print('橙', Dict)
p += 1
turtle.bgcolor("#ff9900")
elif (Dict >= 50 and Dict < 75):
print('黄', Dict)
s += 1
turtle.bgcolor("#ffff00")
elif (Dict >= 75 and Dict <= 100):
print('绿', Dict)
n += 1
turtle.bgcolor("#33cc00")
else:
print('错误!')
turtle.bgcolor("#3333ff")
time.sleep(0.075)
turtle.bgcolor("#ffffff")
print('电脑测试完成。')
print(_E7_86_94_E5_B2_A9)
print('共有', n, '个绿色,', s, '个黄色,', p, '个橙色,', t, '个红色。')
#开始进入Python的世界
_E7_94_B5_E8_84_91_E6_80_A7_E8_83_BD_E6_B5_8B_E8_AF_95()
点赞0
评论