Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write a code that will create this quiz of 5 questions below and will tell you if you're correct or incorrect and then at

please write a code that will create this quiz of 5 questions below and will tell you if you're correct or incorrect and then at the end calculate your score and tell you it.

i will paste my code so far which im stuck on and cant seem to find out what im missing. please fix it.

image text in transcribed

#Taimoor_Mumtaz #Python #Sun

tot = 0 tot = x +1

harrypotter = int(input("How many books are there in the harry potter series? ")) if harrypotter == 7: #if answer is 7 then it is correct print("correct") else: #if answer is anything other than 7 it is incorrect print("incorrect") print("Done")

#math problem math = int(input("What is 3*(2-1)?")) if math == 3: #if answer is 3 then print correct print("correct") else: #if answer is anything other than 3 then print incorrect print("incorrect") print("Done")

#math problem number 2 math2 = int(input("What is 3*2-1?")) if math2 == 5: #if answer is 5 then print correct print("correct") else: #if answer is anything other than 5 then print incorrect print("incorrect") print("Done")

#multiple choice question blackhorse = int(input("Who sings Black Horse and the Cherry Tree? 1. Kelly Clarkson 2. K.T. Tunstall 3. Hillary Duff 4. Bon Jovi")) if blackhorse == 2: #if answer is 2 then print correct print("correct") else: #if answer is anything other than 2 then print incorrect print("incorrect") print("Done")

#multiple choice question two dollarbill = int(input("Who is on the front of a one dollar bill 1. George Washington 2. Abraham Lincoln 3. John Adams 4. Thomas Jefferson ")) if dollarbill == 1: #if answer is 1 then print correct print("correct") else: #if answer is anything other than 1 then print incorrect print("incorrect") print("Done")

score = tot1 + tot2 + tot3 + tot4 + tot5 if (score == 20): print ("Congratulations, you got 1 answer right.") elif (score == 40): print ("Congratulations, you got 2 answers right.") elif (score == 60): print ("Congratulations, you got 3 answers right.") elif (score == 80): print ("Congratulations, you got 4 answers right.") elif (score == 100): else: print ("Congratulations, you got 5 answers right.") print ("This is a Score of", score, "percent.")

Quiz time! How many books are there in the Harry Potter series? 7 Correct! What is 3 (2-1)? 3 Correct! What is 3*2-1? 5 Correct! Who sings Black Horse and the Cherry Tree? 1. Kelly Clarkson 2. K.T. Tunstall 3. Hillary Duff 4. Bon Jovi ?2 Correct! Who is on the front of a one dollar bill 1. George Washington 2. Abraham Lincoln 3. John Adams 4. Thomas Jefferson ? 2 No. Congratulations, you got 4 answers right. That is a score of 80.0 percent

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications Dasfaa 2023 International Workshops Bdms 2023 Bdqm 2023 Gdma 2023 Bundlers 2023 Tianjin China April 17 20 2023 Proceedings Lncs 13922

Authors: Amr El Abbadi ,Gillian Dobbie ,Zhiyong Feng ,Lu Chen ,Xiaohui Tao ,Yingxia Shao ,Hongzhi Yin

1st Edition

3031354141, 978-3031354144

More Books

Students also viewed these Databases questions