QUIZ GAME IN PYTHON

 PROGRAM:

def quiz_game():

    questions={"How many members are there in cricket team?": "11",

               "What is the capital of India?": "delhi",

               "Which planet is known as red planet?": "mars",

               "what is 3*3?": "9"}

    score=0

    print("WELCOME TO QUIZ GAME")

    print("Enter yours answers.\n")

    for questions,answers in questions.items():

        user_input=input(questions).strip().lower()

        if user_input==answers:

            print("Your answer is correct")

            score+=1

        else:

            print("Better lick next time")

    print("QUIZ IS OVER")

if __name__=="__main__":

   quiz_game()

        

        

               

OUTPUT:
WELCOME TO QUIZ GAME
Enter yours answers.

How many members are there in cricket team?11
Your answer is correct
What is the capital of India?delhi
Your answer is correct
Which planet is known as red planet?jupiter
Better lick next time
what is 3*3?9
Your answer is correct
QUIZ IS OVER

Comments

Popular posts from this blog

Bus Booking Application using Tkinter (Python GUI)

ATM Simulation using Python and Tkinter GUI

Healthcare Chatbot Using Tkinter GUI in Python