准备
无需其他文件,复制即用文章来源:https://www.toymoban.com/news/detail-826657.html
代码
import random
list=["春暖花开","十字路口","千军万马","白手起家","张灯结彩","风和日丽","万里长城","人来人往","自由自在","瓜田李下","助人为乐","白手起家","红男绿女","春风化雨","马到成功","拔苗助长","安居乐业","走马观花","念念不忘","落花流水","张灯结彩","一往无前","落地生根","天罗地网","东山再起","一事无成","山清水秀","别有洞天","语重心长","水深火热","鸟语花香","自以为是"]
i=1
count=20
print('直接填写答案,回车进入下一关。什么也不填忽略本成语!!')
while True:
word= random.choice(list)
bank= random.randint(0,3)
new =word[:bank] +"___" +word[bank+1:]
print(new)
num=input("输入:")
if not num:
print("过!")
continue
elif num.strip(" ")==word[bank]:
count+=2
print("正确,你真棒!")
else:
count-=2
print("错了,正确答案:",word[bank])
i+=1
if i>8 :
break
print("选手最后得分:",count)
效果
文章来源地址https://www.toymoban.com/news/detail-826657.html
到了这里,关于python-产品篇-游戏-成语填填乐的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!