单词默写小程序-py
作者:互联网
# 单词默写小程序。
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
标签:str,py,answers,单词,默写,questions,ans,msgbox 来源: https://www.cnblogs.com/dks0313/p/16529602.html