用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字
云代码 - python代码库

KET帮助过单词

2020-03-26 作者: zlqwerty123举报

[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>")


网友评论    (发表评论)


发表评论:

评论须知:

  • 1、评论每次加2分,每天上限为30;
  • 2、请文明用语,共同创建干净的技术交流环境;
  • 3、若被发现提交非法信息,评论将会被删除,并且给予扣分处理,严重者给予封号处理;
  • 4、请勿发布广告信息或其他无关评论,否则将会删除评论并扣分,严重者给予封号处理。


扫码下载

加载中,请稍后...

输入口令后可复制整站源码

加载中,请稍后...