Quiz Program
Make a quiz program. This is basically a bunch of if and elifs with a shape calculator at the end to tell you your score.
Rubric: http://programarcadegames.com/index.php?chapter=lab_create_a_quiz + must have an interactive Bibliography Extra credit if you use a while loop to give the player 1 extra chance when they get it wrong. HINT: Answer Code import webbrowser def quiz(): print "'Welcome to the San Jose Mission. I am Sister Maria." print "I will test your knowledge, young visitor.'" print " " global score score = 0 def question1(): print ("Do you know why the Spaniards built the Spanish Missions in Texas?" + "\n" + "\n" + "a. to teach native americans to adopt Spanish customs," + "\n" + "b. to control the land, thus colonizing the new world," + "\n" + "c. to spread catholicism," + '\n' + "d. all of the above.'") print " " answer1 = raw_input("Make your choice >>>>") if answer1.lower() == "a": print "Wrong" bibliography1() elif answer1.lower() == "b": print "Wrong" bibliography1() elif answer1.lower()== "c": print "Wrong" bibliography1() elif answer1.lower()=="d": print "Correct!" global score score = score +1 print " " bibliography1() else: print "Type only a, b, c, or d." question1() def bibliography1(): source = raw_input ("Learn more online? (y)es or (n)o >>>>") print " " if source.lower() == "y": webbrowser.open("https://tshaonline.org/handbook/online/articles/its02") elif source.lower() == "n": print "Source: https://tshaonline.org/handbook/online/articles/its02" else: print "type y or n." bibliography1() def grade(): total = (score/1.0) * 100 # Change the number 1.0 to the total number of questions in your quiz. # total = (score/4.0) * 100 This is the formula if you have 4 questions in your quiz, the minimum required. grade = str(total) print " " print "You're grade is %s." % grade quiz() question1() # Your quiz needs 3 more question functions called here. Each one also needs a bibliography function. grade() |