Why will the break not end the while true and return to the start?
while True:
print('This is a quiz')
print('What is your name?')
Name = input()
print('Hello ' + Name + ', The quiz will now begin')
import time
time.sleep(2)
question1 = "Question one: "
answer1 = "True" and "true"
print(question1)
qanswer = input()
if qanswer != answer1:
print('Sorry, the answer is: ' + answer1)
break
if answer1 == qanswer:
print("Correct! Here's the next question")
I'm pretty new to python so I assume it's just a simple misuse of the terms.
answer1 = "True" and "true"This is not doing what you think it is. Try printinganswer1after you create the variable. If you want to compare the user input to two different strings, you need to compare the input against both strings. Documentation on andanswer1 = "True" and "true".