Harrypotter Quiz Program

 def intr():
    print("------------------------------------------")
    print("   Being A Potter head.....")
    print("------------------------------------------")
    print("Hello Guys!!!")
    print("Lets Start Our journey Into the Magical World Of Hogwarts...")
    print("------------------------------------------")

def quiz():
    Score=0
    print("1.Which sport is practised in Hogwarts?")
    print()
    ques1opt=["1.Football","2.Cricket","3.Quidditch","4.Hockey"]
    for i in ques1opt:
            print(i)
    ans1=int(input("Enter your answer here : "))
    if (ans1==3):
           print("Awesome!Correct Answer...")
           Score=Score+10
    elif(ans1>4):
        print("Invalid answer..")
    else:
        print("Oops!Wrong Answer...")
    print("------------------------------------------")
        
    print("2.Who is the author  of Harry potter?")
    ques2opt=["1.J.K.Rowling","2.Rick Riorden","3.Robin Sharma","4.Chetan Bhagath"]
    for i in ques2opt:
        print(i)
    ans2=int(input("Enter your answer here : "))
    if (ans2==1):
        print("Awesome!Correct Answer...")
        Score=Score+10
    elif(ans2>4):
        print("Invalid answer..")
    else:
        print("Oops!Wrong Answer...")
    print("------------------------------------------")
        
    print("3.How do students choose their groups in hogwarts?")
    ques3opt=["1.Proffesor.McGonagall","2.The Sorting Hat","3.Adolf Dumbledore","4.Their Wish"]
    for i in ques3opt:
        print(i)
    ans3=int(input("Enter your answer here : "))
    if (ans3==2):
        print("Awesome!Correct Answer...")
        Score=Score+10
    elif(ans3>4):
        print("Invalid answer..")
    else:
        print("Oops!Wrong Answer...")
    print("------------------------------------------")
        
    print("4.Who is elf of Harry potter?")
    ques4opt=["1.Dobby","2.Winky","3.Kreacher","4.Hokey"]
    for i in ques4opt:
        print(i)
    ans4=int(input("Enter your answer here : "))
    if (ans4==1):
        print("Awesome!Correct Answer...")
        Score=Score+10
    elif(ans4>4):
        print("Invalid answer..")
    else:
        print("Oops!Wrong Answer...")
    print("------------------------------------------")
        
    print("5.Who is TOM MARVOLO RIDDLE?")
    ques5opt=["1.Draco","2.Severus Snape","3.Ronald Weasley","4.Voldemort"]
    for i in ques5opt:
        print(i)
    ans5=int(input("Enter your answer here : "))
    if (ans5==4):
        print("Awesome!Correct Answer...")
        Score=Score+10
    elif(ans5>4):
        print("Invalid answer..")
    else:
        print("Oops!Wrong Answer...")  
    print("------------------------------------------")
    
    print("6.Who is not a friend of Harry potter?")
    ques6opt=["1.Ronald Weasley","2.Draco Malfoy","3.Ginny Weasley","4.Hermione Granger"]
    for i in ques6opt:
        print(i)
    ans6=int(input("Enter your answer here : "))
    if (ans6==2):
        print("Awesome!Correct Answer...")
        Score=Score+10
    elif(ans6>4):
        print("Invalid answer..")
    else:
        print("Oops!Wrong Answer...")
    print("------------------------------------------")
        
    print("7.How is SIRIUS BLACK related to HARRY POTTER?")
    ques7opt=["1.Father","2.God Father","3.Friend","4.Son"]
    for i in ques7opt:
        print(i)
    ans7=int(input("Enter your answer here : "))
    if (ans7==2):
        print("Awesome!Correct Answer...")
        Score=Score+10
    elif(ans7>4):
        print("Invalid answer..")
    else:
        print("Oops!Wrong Answer...")
    print("------------------------------------------")

    print("8.Who did Hermione take to the Yule Ball in Book 4?")
    ques8opt=["1.Viktor Krum","2.Ron Weasley","3.Cedric Diggory","4.Harry Potter"]
    for i in ques8opt:
        print(i)
    ans8=int(input("Enter your answer here : "))
    if (ans8==1):
        print("Awesome!Correct Answer...")
        Score=Score+10
    elif(ans8>4):
        print("Invalid answer..")
    else:
        print("Oops!Wrong Answer...")
    print("------------------------------------------")
        
    print("9.Who does Harry Potter marry?")
    ques9opt=["1.Hermoine Granger","2.Cho Chang","3.Luna Lovewood","4.Ginny Weasley"]
    for i in ques9opt:
        print(i)
    ans9=int(input("Enter your answer here : "))
    if (ans9==4):
        print("Awesome!Correct Answer...")
        Score=Score+10
    elif(ans9>4):
        print("Invalid answer..")
    else:
        print("Oops!Wrong Answer...")
    print("------------------------------------------")
        
    print("10.What is the occupation of Hermione’s parents?")
    ques10opt=["1.Engineers","2.Doctor","3.Dentists","4.Wizards"
    for i in ques10opt:
        print(i)
    ans10=int(input("Enter your answer here : "))
    if (ans10==3):
        print("Awesome!Correct Answer...")
        Score=Score+10
    elif(ans10>4):
        print("Invalid answer..")
    else:
        print("Oops!Wrong Answer...")
    print("------------------------------------------")
    print("Your Total Score is",Score)
    if(Score>=90):
        print("Really A True Potter Head!!!")
    elif(Score>=80):
        print(" Hurry!!Hagrid is waiting for you at the Hogwarts Station...")
    elif(Score>=50):
        print("Hogwarts Professors are eager to teach to more....")
    else:
        print("Your Books are longing to see you reading...")
        
intr()
quiz()


Output:

------------------------------------------ Being A Potter head..... ------------------------------------------ Hello Guys!!! Lets Start Our journey Into the Magical World Of Hogwarts... ------------------------------------------ 1.Which sport is practised in Hogwarts? 1.Football 2.Cricket 3.Quidditch 4.Hockey Enter your answer here : 3 Awesome!Correct Answer... ------------------------------------------ 2.Who is the author of Harry potter? 1.J.K.Rowling 2.Rick Riorden 3.Robin Sharma 4.Chetan Bhagath Enter your answer here : 1 Awesome!Correct Answer... ------------------------------------------ 3.How do students choose their groups in hogwarts? 1.Proffesor.McGonagall 2.The Sorting Hat 3.Adolf Dumbledore 4.Their Wish Enter your answer here : 3 Oops!Wrong Answer... ------------------------------------------ 4.Who is elf of Harry potter? 1.Dobby 2.Winky 3.Kreacher 4.Hokey Enter your answer here : 2 Oops!Wrong Answer... ------------------------------------------ 5.Who is TOM MARVOLO RIDDLE? 1.Draco 2.Severus Snape 3.Ronald Weasley 4.Voldemort Enter your answer here : 4 Awesome!Correct Answer... ------------------------------------------ 6.Who is not a friend of Harry potter? 1.Ronald Weasley 2.Draco Malfoy 3.Ginny Weasley 4.Hermione Granger Enter your answer here : 3 Oops!Wrong Answer... ------------------------------------------ 7.How is SIRIUS BLACK related to HARRY POTTER? 1.Father 2.God Father 3.Friend 4.Son Enter your answer here : 2 Awesome!Correct Answer... ------------------------------------------ 8.Who did Hermione take to the Yule Ball in Book 4? 1.Viktor Krum 2.Ron Weasley 3.Cedric Diggory 4.Harry Potter Enter your answer here : 1 Awesome!Correct Answer... ------------------------------------------ 9.Who does Harry Potter marry? 1.Hermoine Granger 2.Cho Chang 3.Luna Lovewood 4.Ginny Weasley Enter your answer here : 4 Awesome!Correct Answer... ------------------------------------------ 10.What is the occupation of Hermione’s parents? 1.Engineers 2.Doctor 3.Dentists 4.Wizards Enter your answer here : 3 Awesome!Correct Answer... ------------------------------------------ Your Total Score is 70 Hogwarts Professors are eager to teach to more....

If you have any doubts, feel free to post it in comment Section.

Comments

Popular posts from this blog

Guessing the Number Game

Find the final amount after Discount

Simple Arithmetic Calculator - User Defined Function