[python]代码库
import random
word = ["ability", "able", "absent", "accept", "access", "accident", "accommodation", "accompany", "account", "accurate", "ache", "achieve", "act", "action", "active", "activity", "actual", "add", "addition", "address", "admire", "admit", "adult", "advance", "advanced", "advantage", "adventure", "advertise", "advertisement", "advertising", "advice", "advise", "aeroplane", "afford", "afraid", "afterwards", "against", "age", "agency"]
chinese = ["能力", "有能力的", "缺席的", "接受", "通道", "事故", "住处", "陪同", "账户", "正确的", "疼痛", "实现", "v.行动", "n.行动", "积极的", "活动", "实际的", "v.增加", "n.增加", "地址", "欣赏", "承认", "成年人", "前进", "先进", "优势", "冒险", "做广告", "广告", "广告业", "n.建议", "v.建议", "飞机", "买得起", "害怕的", "后来", "反对", "年龄", "服务机构"]
score = 0
print("> If you don't want to do it,hit break\n>")
running = 1
while running == 1:
x = random.randint(-1, 38)
print(f"> The word is {word[x]}\n> Please hit it in Chinese")
a = input("> ")
if a == "break":
print(f"> You have gotten {score} score\n> Goodbye!")
running = 2
else:
if a == chinese[x]:
print("> You are right!!!\n>")
score += 1
else:
print("> You are wrong")
print(f"> It means {chinese[x]}\n>")
x = random.randint(-1, 38)
print(f"> The word is {chinese[x]}\n> Please hit in English")
b = input("> ")
if b == "break":
print(f"> You have gotten {score} score\n> Goodbye")
running = 2
else:
if b == word[x]:
print("> You are right!!!\n>")
score += 1
else:
print("> You are wrong")
print(f"> It means {word[x]}\n>")