enter code here
I am just learning python and recently I made my first project which is a quiz. By looking at my code you can see that I have variables called q1, q2 etc which are all under the main if statement at the beginning. For some reason the first 'else' statement returns the printed text 'nope' when you get the answer wrong, but after the first question, it only prints 'correct' even if you get the answer wrong. I hope someone can help. Thanks.
print ("Hello. Welcome to the quiz. You will have 10 minutes to complete the quiz and will be graded as you take it. Good Luck!")
begin = raw_input("Would you like to begin?: ")
if begin == "yes" or "Yes":
print("Great! Lets get started")
print ("A) The raw_input function waits for the user to type some input and press return. It then gets whatever was typed.")
print ("B) It is a way to adjust the last variable written.")
print ("C) It is the same as the 'input' function.")
print ("D) It is not something that is built into python")
q1 = raw_input("What is a raw input and what does it do?: ")
if q1 == "A" or q1 == "a" :
print ("Correct!")
print("")
else:
print("nope")
print("")
print ("A) Any number that is a fraction.")
print ("B) Any whole number that has a deceimal point.")
print ("C) A data type that is a whole number and not a float.")
print ("D) Any irational number.")
q2 = raw_input("What is an integer?: ")
if q2 == "C" or "c" :
print ("Correct!")
print("")
else:
print("nope")
print("")
print ("A) Any character or set of characters within single or double quotes.")
print ("B) Any character or set of characters outside of quotes.")
print ("C) A condition that can be changed depending on conditions passed through the program")
print ("D) A set of whole numbers that are not fractions or floats.")
q3 = raw_input("what is a string?")
if q3 == "a" or "A" :
print("Correct!")
print("")
else:
print("Sorry that is not correct.")
print("")
print ("A) a,b,c,d,e ")
print ("B) This will give you a syntax error")
print ("C) It will print 'x'")
print ("D) Nothing")
q4 = raw_input("What will print, given the following code: x = [a,b,c,d,e], print x?: ")
if q4 == "a" or "A" :
print ("Correct!")
else:
print("Sorry the answer is 'A'")
print("")
print ("A) Loops allow us to execute a statement or group of statements multiple times.")
print ("B) A group of lists set as a variable.")
print ("C) A sequence of immutable Python objects.")
print ("D) A data structure that includes 'if, else' statements.")
q5 = raw_input("Which gives the best definition of a loop?")
print("")
if q5 == "a" or "A":
print("Correct!")
else:
print("nope. The asnwer is A")