We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,376 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

how to loop and how to add score?

how to loop and how to add score?
and i want to make sure that people can ask how many question the want to answer in my quiz. how can i do that?

# make input equal to Python3 style input even in Python2
try:
    input = raw_input
except:
    pass
def questions ():
    global questionlist
    print =("how many question do you want to answer")
    while questioncount < 4:
while 

print("Welcome to my yes or no quiz!")
questions = (("Denis Glover wrote the poem The Magpies ", 'yes'),
             ("God Save the King was New Zealand’s national anthem up to and including during WWII  ", 'yes'),
             ("Kiri Te Kanawa is a Wellington-born opera singer  ", 'no'),
             ("Phar Lap was a New Zealand born horse who won the Melbourne Cup  ", 'yes'),
             ("Queen Victoria was the reigning monarch of England at the time of the Treaty  ", 'yes'),
             ("Split Enz are a well-known rock group from Australia who became very famous in New Zealand during the 80s  ", 'no'),
             ("Te Rauparaha is credited with intellectual property rights of Kamate!  ", 'yes'),
             ("The All Blacks are New Zealands top rugby team ", 'yes'),
             ("The Treaty of Waitangi was signed at Parliament  ", 'no'),
             ("The Treaty of Waitangi was signed in 1901 ", 'no'),
             ("Aotearoa commonly means Land of the Long White Cloud   ", 'yes'))


for q, right in questions:
    if input(q).lower() == right:
        print("Well done! You got it right!")
    else:
        print("You got it wrong this time!")
1
Contributor
1
Reply
25 Minutes
Discussion Span
6 Months Ago
Last Updated
2
Views
Question
Answered
dean.ong.14
Junior Poster in Training
52 posts since Aug 2012
Reputation Points: -8
Solved Threads: 0
Skill Endorsements: 0

thank you so much!!!!!! last question.... how to extend the quiz to add more user friendly and robust features? an how to add comment?

dean.ong.14
Junior Poster in Training
52 posts since Aug 2012
Reputation Points: -8
Solved Threads: 0
Skill Endorsements: 0
Question Self-Answered as of 6 Months Ago

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0600 seconds using 2.67MB