Python ion10(): 全球总数 打印(“问题10.Vinu购买40卢比的股票,支付9%的股息。他想获得12%的利息。找到每股的市场价值”) 打印(“\n A.30 C.65”) 印刷品(“\n B.85 D.33”) 回答=输入(“输入您的ans:”) 如果答案==“A”: 总数+=50 打印(“正确答案”) 其他: 总数-=30 打印(“错误答案”) 问题10() 打印(“您的分数是:”,总计) 如果总数=500: 打印(“你赢了10万”) elif总计>=400,总计=300,总计=200且总计

Python ion10(): 全球总数 打印(“问题10.Vinu购买40卢比的股票,支付9%的股息。他想获得12%的利息。找到每股的市场价值”) 打印(“\n A.30 C.65”) 印刷品(“\n B.85 D.33”) 回答=输入(“输入您的ans:”) 如果答案==“A”: 总数+=50 打印(“正确答案”) 其他: 总数-=30 打印(“错误答案”) 问题10() 打印(“您的分数是:”,总计) 如果总数=500: 打印(“你赢了10万”) elif总计>=400,总计=300,总计=200且总计,python,Python,正如其他人所指出的,当您调用菜单()时,尚未定义名称问题。因此,只需将其更改为: 导入操作系统 def菜单(): 打印(“您好,欢迎参加问答游戏”) 打印(“按1开始”) 打印(“按2退出”) 选择=输入(“输入您的选择:”) 操作系统(“cls”) 如果选项==“1”: 问题() elif choice==“2”: 操作系统(“cls”) 其他: 打印(“无效选择”) 定义问题(): 全球总数 总数=0 定义问题1(): 全球总数 print(r“问题1.一名男子指着一张照片说,‘我没有兄弟,

正如其他人所指出的,当您调用
菜单()
时,尚未定义名称
问题。因此,只需将其更改为:

导入操作系统
def菜单():
打印(“您好,欢迎参加问答游戏”)
打印(“按1开始”)
打印(“按2退出”)
选择=输入(“输入您的选择:”)
操作系统(“cls”)
如果选项==“1”:
问题()
elif choice==“2”:
操作系统(“cls”)
其他:
打印(“无效选择”)
定义问题():
全球总数
总数=0
定义问题1():
全球总数
print(r“问题1.一名男子指着一张照片说,‘我没有兄弟,那个人的父亲是我父亲的儿子。’这是谁的照片?’
印刷品(“\n A.他的儿子C.他的父亲”)
印刷品(“\n B.他自己的D.他的侄子”)
回答=输入(“输入您的ans:”)
如果答案==“A”:
总数+=50
打印(“正确答案”)
其他:
总数-=30
打印(“错误答案”)
问题1()
输入(“按enter键继续;)”)
操作系统(“cls”)
定义问题2():
全球总数
打印(r“问题2如果*means/,-means*,/means+和+means-,那么(3-15/19)*8+3=?”)
打印(“\n A.-1 C.2”)
打印(“\n B.8 D.1”)
回答=输入(“输入您的ans:”)
如果答案='D':
总数+=50
返回打印(“正确答案”)
其他:
总数-=30
打印(总计)
返回打印(“错误答案”)
问题2()
输入(“按enter键继续;)”)
操作系统(“cls”)
定义问题3():
全球总数
打印(r“问题3:当字母表按逆字母顺序书写时,是否在第8位找到字母?”)
打印(“\n A.A.C.B”)
打印(“\n B.S.D.E”)
回答=输入(“输入您的ans:”)
如果答案==“C”:
总数+=50
打印(“正确答案”)
其他:
总数-=30
打印(“错误答案”)
问题3()
输入(“按enter键继续;)”)
操作系统(“cls”)
定义问题4():
全球总数
打印(r“问题4在下面的问题中,从给定的备选方案中选择奇数词。”)
打印(“\n A.神经学家C.牙医”)
打印(“\n B.建筑师D.儿科医生”)
回答=输入(“输入您的ans:”)
如果答案==“B”:
总数+=50
打印(“Corect答案”)
其他:
总数-=30
打印(“错误答案”)
打印(总计)
问题4()
输入(“按enter键继续;)”)
操作系统(“cls”)
定义问题5():
全球总数
打印(r“问题。5使用下面定义的关系,回答以下问题\n A+B表示A是B的母亲。\n A-B表示A是B的姐妹。\n A*B表示A是B的父亲。\n A/B表示A是B的儿子。\n A=B表示A是B的兄弟。\n A!=B表示A是B的女儿。)
打印(“\n应付账款-R/Q应付账款+R*Q”)
打印(“\n B.P!=R*qd.P-R+Q”)
回答=输入(“输入您的ans:”)
如果答案='D':
总数+=50
打印(“正确答案”)
其他:
总数-=30
打印(“错误答案”)
打印(总计)
问题5()
输入(“按enter键继续;)”)
操作系统(“cls”)
定义问题6():
全球总数
打印(r“问题6.A母亲的儿子唯一的妹妹是B。如果B是C女儿的母亲,A与C有何关系?”)
打印(“\n A.兄弟C.姐夫”)
打印(“\n B.叔叔D.侄子”)
回答=输入(“输入您的ans:”)
如果答案==“C”:
总数+=50
打印(“正确答案”)
其他:
总数-=30
打印(“错误答案”)
打印(总计)
问题6()
输入(“按enter键继续;)”)
操作系统(“cls”)
定义问题7():
全球总数
打印(“问题7,如果在某种代码语言中,‘oka peru’表示‘细布’;‘meta lisa’表示‘清水’,‘dona lisa peru’表示‘晴朗的天气’,该语言中哪个词表示‘天气’?)
打印(“\n A.peru C.oka”)
打印(“\n B.meta D.dona”)
答案=输入(“输入答案:”)
如果答案='D':
总数+=50
打印(“正确答案”)
其他:
总数-=30
打印(“错误答案”)
问题7()
输入(“按enter键继续;)”)
操作系统(“cls”)
定义问题8():
全球tot
import os
def menu():
    print("                            HELLO, WELCOME TO QUIZ GAME")
    print("\n press 1 for start")
    print("\n press 2 for exit")
    choice = input("Enter your choice : ")
    os.system('cls')         
    if choice == '1':
        question()
    elif choice == '2':
        os.system('cls')
    else:
        print("Invalid Choice")         
menu() 


def question():
    global total
    total = 0
    def question1():
        global total
        print(r"QUESTION 1. Pointing to a photograph, a man said, 'I have no brother, and that man's father is my father's son.' Whose photograph was it?")
        print("\n A.His son                             C.His father ")
        print("\n B.His own                             D.His nephew")
        answer = input("Enter Your ans : ")
        if answer == 'A':
            total+=50
            print("Correct answer")
        else:
            total-=30
            print("Wrong answer")   
    question1()
    input("Press enter to continue ;)")
    os.system('cls')    

    def question2():
        global total
        print(r"QUESTION.2 If * means /, - means *, / means + and + means -, then (3 - 15 / 19) * 8 + 3 = ?") 
        print("\n A.-1                                C.2 ")
        print("\n B.8                                 D.1 ") 
        answer = input("Enter Your ans : ")
        if answer == 'D':
            total+=50
            return print("Corrrect answer")
        else:
            total-=30
            print(total)
            return print("Wrong answer")
    question2() 
    input("Press enter to continue ;)")
    os.system('cls')

    def question3():
        global total
        print(r"QUESTION.3 Find the letter in the 8th position when the alphabets are written in  reverse alphabetical order ?")
        print("\n A.A                                     C.B ")
        print("\n B.S                                     D.E ")
        answer = input("Enter your ans : ")
        if answer == 'C':
            total+=50
            print("Correct answer")
        else:
            total-=30
            print("wrong answer")
    question3()  
    input("Press enter to continue ;)")
    os.system('cls')

    def question4():
        global total
        print(r"QUESTION.4 In the following question, select the odd word from the given alternatives.") 
        print("\n A.Neurologist                          C.Dentist")
        print("\n B.Architect                            D.Pediatrician") 
        answer = input("Enetr your ans : ")
        if answer == 'B':
            total+=50
            print("Coreect Answer")
        else:
            total-=30
            print("Wrong Answer")
        print(total)    
    question4()
    input("Press enter to continue ;)")
    os.system("cls")

    def question5():
        global total
        print(r"QUESTION.5 Use the relations defined below and answer the following question \n A + B means A is the mother of B. \n A - B means A is the sister of B. \n A * B means A is the father of B. \n A / B means A is the son of B. \n A = B means A is the brother of B. \n A != B means A is the daughter of B.")
        print("\n A.P - R / Q                             C.P + R * Q")
        print("\n B.P != R * Q                            D.P - R + Q")
        answer = input("Enter Your ans : ")
        if answer == 'D':
            total+=50
            print("Correct Answer")
        else:
            total-=30
            print("wrong answer")
        print(total)
    question5()
    input("Press enter to continue ;)")
    os.system("cls")

    def question6():
        global total
        print(r"QUESTION 6. A's mother's son's only sister is B. How is A related to C, if B is the mother of C's daughter ?") 
        print("\n A.Brother                                C.Brother-in-law")
        print("\n B.uncle                                  D.Nephew") 
        answer = input("Enetr your ans : ")
        if answer == 'C':
            total+=50
            print("Correct answer")
        else:
            total-=30
            print("Wrong answer")
        print(total)
    question6()
    input("Press enter to continue ;)")
    os.system('cls')

    def question7():
        global total
        print("QUESTION.7 If in a certain code language, 'oka peru' means 'fine cloth' ; 'meta lisa' means 'clear water' and 'dona lisa peru' means 'fine clear weather' , which word in that language means 'weather'?")
        print("\n A.peru                                   C.oka")
        print("\n B.meta                                   D.dona") 
        answer = input("Enter your answer : ")
        if answer == 'D':
            total+=50
            print("Correct answer")
        else:
            total-=30
            print("wrong answer")
    question7()
    input("Press enter to continue ;)")
    os.system('cls')

    def question8():
        global total
        print("QUESTION.8 Radiant : Brilliant :: Zenith : ?") 
        print("\n A.Peak                                 C.Cheerful")
        print("\n B.Misery                               D.Abet")
        answer = input("Enetr Your ans : ")
        if answer == 'A':
            total+=50
            print("Correct answer")
        else:
            total-=30
            print("wrong answer")
    question8()
    input("Press enetr to continue ;)")
    os.system('cls')

    def question9():
        global total
        print("QUESTION.9 69 - 51 + 62 * 61 / 54")
        print("\n A.94.04                                C.88.04")
        print("\n B.92.04                                D.85.04")
        answer = input("Enter your ans : ")
        if answer == 'C':
            total+=50
            print("Correct answer")
        else:
            total-=30
            print("Wrong answer")
    question9()
    input("Press enter to continue;)")
    os.system('cls')

    def question10():
        global total
        print("QUESTION.10 Vinu buys Rs. 40 shares paying 9 % dividend. He wants to have an interest of 12% of his money. Find the market value of each share")
        print("\n A.30                                    C.65")
        print("\n B.85                                    D.33")
        answer = input("Enter your ans : ")
        if answer == 'A':
            total+=50
            print("Correct answer")
        else:
            total-=30
            print("Wrong answer") 
    question10()    

    print("Your point is : ",total)
    if total == 500:
        print("You won 1 lakh ")
    elif total >= 400 and total <500:  
        print("You Won 50K")
    elif total >= 300 and total < 400:
        print("You Won 25K")
    elif total >= 200 and total < 300:
        print("You Won 10K")
    else:
        print("Sorry,better luck next time ")                         

# question()     


input("Press enter to exit ;)")