Reputation: 17
I'm writing a quiz program. However, only the first question is printing. Not even the first sentence.
What am I doing wrong?
Here is the code:
import math
import string
import random
print("Simple Star Wars quiz. (SPOILERS!!!) Made by Andy Chakarov.")
cor1 = "Anakin Skywalker" #What other name does Darth Vader go by? (hint: he said that it doesnt mean anything to him anymore in episode 6 Return of the Jedi)
cor2 = "Ben Solo" #What was the original name of Kylo Ren?
cor3 = "Death Star" #What was the ultimate weapon that was rebuilt 3 times
wrong = 0
g1 = input("What other name does Darth Vader go by? (hint: he said that it doesnt mean anything to him anymore in episode 6 Return of the Jedi): ")
if g1 == cor1:
print("Congratulations! You got the answer right!")
else:
print("That's not true!")
wrong + 1
g2 = input("What was the original name of Kylo Ren?: ")
if g2 == cor2:
print("Congratulations! You got the answer right!")
else:
print("That's not true!")
wrong + 1
g3 = input("What was the ultimate weapon that was rebuilt 3 times?: ")
if g3 == cor3:
print("Congratulations! You got the answer right!")
else:
print("That's not true!")
wrong + 1
print("The quiz is over! You got", wrong, "answers out of 3!")
Upvotes: 0
Views: 72
Reputation: 364
It works.
Just that you get a 0 score even if you answer all the questions right.
Thats because you've specified wrong
in the final result.
Simple Star Wars quiz. (SPOILERS!!!) Made by Andy Chakarov.
What other name does Darth Vader go by? (hint: he said that it doesnt mean anything to him anymore in episode 6 Return of the Jedi): Anakin Skywalker
Congratulations! You got the answer right!
What was the original name of Kylo Ren?: Ben Solo
Congratulations! You got the answer right!
What was the ultimate weapon that was rebuilt 3 times?: Death Star
Congratulations! You got the answer right!
The quiz is over! You got 0 answers out of 3!
And regarding it only printing the 1st sentence..I wonder what tool/IDE you're using to run this? You're probably not seeing an option to enter the input values. Better try running it on something like a Jupyter notebook for example and you can see that option
Upvotes: 1