# 单词默写小程序。
import easygui as e
questions = ["局部", "野怪", "重复", "添加", "动画"]
answers = ["local", "monster", "repeat", "append", "animation"]
# 计算列表questions的长度。
length = len(questions)
n = 0
n2 = 0
while n <= length-1:
ans = e.enterbox("NO."+str(n+1)+" "+questions[n]+"的英语单词是?")
# 判断ans是否为answers里的单词。
if ans == answers[n]:
e.msgbox("恭喜您是大聪明,得"+str((n2+1)*100)+"分。")
n2 += 1
else:
e.msgbox("您错了一个,继续加油!")
# n = n-1
n += 1
原创文章,作者:Carrie001128,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/277606.html