python quiz and keep score

Solutions on MaxInterview for python quiz and keep score by the best coders in the world

showing results for - "python quiz and keep score"
Kinley
17 Nov 2016
1score = 0
2score = int(score)
3
4#Ask user for their name
5name = input("What is your name?")
6name = name.title()
7print("""Hello {}, welcome to Quiz night! 
8You will be presented with 5 questions.
9Enter the appropriate number to answer the question
10Good luck!""".format(name))
11
12#Question1
13print("""Question here
141.  
152.  
163.  
174. """)
18
19answer1 = "correct number here"
20response1 = input("Your answer is: ")
21
22if (response1 != answer1):
23    print("Sorry, that is incorrect!")
24else:
25    print("Well done! " + response1 + " is correct!")
26    score = score + 1
27
28print("Your current score is " + str(score) + " out of 5")
29
30#Question2
31print("""What is the name of the town your character lives in before The Great War?
321. Diamond City 
332. Sanctuary Hills 
343. Concord 
354. The Glowing Sea""")
36
37answer2 = "correct number here"
38response2 = input("Your answer is:")
39
40if (response2 != answer2):
41    print("Sorry, that is incorrect!")
42else:
43    print("Well done! " + response2 + " is correct!")
44    score = score + 1
45
46print("Your current score is " + str(score) + " out of 5")
47
48#Question3
49print("""Question here
501.  
512.  
523.  
534. """)
54
55answer3 = "correct number here"
56response3 = input("Your answer is:")
57
58if (response3 != answer3):
59    print("Sorry, that is incorrect!")
60else:
61    print("Well done! " + response3 + " is correct!")
62    score = score + 1
63
64print("Your current score is " + str(score) + " out of 5")
65
66#Question4
67print("""Question here
681. 
692. 
703. 
714. """)
72
73answer4 = "correct number here"
74response4 = input("Your answer is:")
75
76if (response4 != answer4):
77    print("Sorry, that is incorrect!")
78else:
79    print("Well done! " + response4 + " is correct!")
80    score = score + 1
81
82print("Your current score is " + str(score) + " out of 5")
83
84#Question5
85print("""Question here
861. False
872. True""")
88
89answer5 = "correct number here"
90response5 = input("Your answer is:")
91
92if (response5 != answer5):
93    print("Sorry, that is incorrect!")
94else:
95    print("Well done! " + response5 + " is correct!")
96    score = score + 1
97
98print("Your total score is " + str(score) + " out of 5")
99print("Thank you for playing {}, goodbye!".format(name))
queries leading to this page
python built in functions quizpython online quizepython quiz code with scorepython quiz fix codeprogramming quiz pythonmake a quiz pythonquiz app with pythoncreare quiz in pythonquizlet quizes pythonquizlet pythonpython quizizzpython quizletpython list quizpython quiz applicationcreate quiz with answers pythononline python quizespython writing a quizpython quiz codehow to make a quiz in pythonpython programming quizletfree python quizezpython score systempython coding quizpython quiz projectquiz in pythonquiz generator pythonsimple quiz using pythonquize python control statementpython quiz templatedefine quiz pythonquize pythonpython quizsquizz pythonquiz on python librariespython quizpython random quiz quiz program in pythonpython quizzezhow to make a quiz application in pythonpython quiz onlinepython quiz with answerspython functions quizquiz application in pythonhow to create quiz question in pythonpython quiz librarypython quiz code examplespython quiz and keep scorepython tutorial quizpython quiz programhow to code a quiz in pythonmake a python quiz and keep scorepython programming quizzespython score codepython quiz functionspython quiz testhow to create a quiz application in pythonhow to do quiz in pythonpython library for quizesquiz python codeonline python quizpython online quizquiz game pythonpython quiz questionsquiz python programminghow to create quiz in python online quiz in pythondaily python quizpython apply quizpython quiz appquiz on pythonquiz about functions pythonpython quizesquiz pythonpython quizzespython quiz with scorepython quiz gamespython quiz for functionpython quizzdoing python quizpython quiz for beginnerspython quiz and keep score