猫史档案馆


【Python作品分享】口算app【作业帖】

用户:陈柚子陈柚子查看:0 回复:0 评论:0 创建时间:2021-07-12T17:09:45


【作品展示】

center_image

 

【作品介绍】

这是一个口算app,可以帮你提升口算能力。最近出现了一个彩蛋,如果在乘法计算答题时输入yyds,会有隐藏彩蛋!

 

【作品源代码】

import random
D = 0
DY = 0

Q = input("加减计算请按1,减法计算请安2,乘法计算请按3,除法计算请按4:")
if Q == "1":
    for i in range(10):
        A = random.randint(0,700)
        B = random.randint(0,700)
        D = A + B
        QQ = input(str(A)+"+"+str(B)+"=")
        if QQ == str(D):
            print("回答正确!")
            DY += 1
        else:
            print("回答错误")
    print("10题中,你一共答对了"+str(DY)+"题")

elif Q == "2":
    for i in range(10):
        A = random.randint(0, 700)
        B = random.randint(0,A)
        D = A - B
        QQ = input(str(A)+"-"+str(B)+"=")
        if QQ == str(D):
            print("回答正确!")
            DY += 1
        else:
            print("回答错误")
    print("10题中,你一共答对了"+str(DY)+"题")
elif Q == "3":
    for i in range(10):
        A = random.randint(0, 100)
        B = random.randint(0, 10)
        D = A * B
        QQ = input(str(A)+"*"+str(B)+"=")
        if QQ == str(D):
            print("回答正确!")
            DY += 1
        elif QQ == "yyds":
            print("欢迎来到 永远的神 游戏!")
            HH = input("请选择职业:永远 请按 1,的 请按2,神 请按3:")
            if HH == "1":
                print("你的职业为 永远,请永远别说不!请告诉我,你该怎么做?")
                QQ = input("你的回答:")
                if "不" in QQ:
                    print("你没做到,再见~(0^0)~")
                elif QQ == "":
                    print("哦,你懂我的!你获胜了~")
                else:
                    print("呵呵,我好像听不懂=(6.9))呵呵呵呵呵呃呃呃哈哈和呃呃哈哈嗯嗯")
            elif HH == "2":
                print("你的职业是 的,你的任务是说出1+2+3+4+5+6+7+8+9+11的答案是几")
                QQ = input("你的回答:")
                if QQ == "1+2+3+4+5+6+7+8+9+11的答案是几":
                    print("哇,你竟然答对了!没错,我把你当成了**")
                elif QQ == "1+2+3+4+5+6+7+8+9+10的答案是几":
                    print("马虎大意的家伙<(&^&)>")
                elif QQ == "55":
                    print("马虎大意的家伙<(&^&)>")
                elif QQ == "56":
                    print("哇,算对了!yyds,但是,你回答错了,你没有完成任务!")
                else:
                    print("呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃,看不懂!")
            elif HH == "3":
                print("只有作者可以当神")
                QQ = input("你的回答:")
                if QQ == "我就是神!":
                    print("啊啊啊哈哈哈啊哈哈哈,天亮了,起床咯!")
                elif QQ == "我就是柚子!":
                    print("柚子yyds!")
                else:
                    print("阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴……")
        else:
            print("回答错误")
    print("10题中,你一共答对了"+str(DY)+"题")
elif Q == "4":
    for i in range(10):
        B = random.randint(0,100)
        D = random.randint(0,30)
        A = B * D
        QQ = input(str(A)+"/"+str(B)+"=")
        if QQ == str(D):
            print("回答正确!")
            DY += 1
        else:
            print("回答错误")
    print("10题中,你一共答对了"+str(DY)+"题")
else:
    print("输入有误,请重启软件重新开始")

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页