单词检查机
# 设置是否检查的变量
check = True
# 设置生词本
word_list = {"教师":"tutor","前进":"forward","后退":"backward","向左":"left","向右":"right","向右":"right"}
# 设置检查本
check_list = {}
while check:
# 将生词本赋值到检查本中
check_list = word_list.copy()
# 循环比较检查本的单词,回答正确就删除生词本中的单词
for key,value in check_list.items():
inp = input("{}的英文是:".format(key))
if inp == value:
del word_list[key]
print("回答正确")
else:
print("回答错误")
# 如果生词本中还有单词就回头复习
if len(word_list)>0:
print(word_list)
check = input("这些单词还需要巩固吗?True/False")
else:
check = False
print("恭喜你全部掌握")