В чем разница в использовании «или» вместо «и» в строке 3?Python

Программы на Python
Anonymous
В чем разница в использовании «или» вместо «и» в строке 3?

Сообщение Anonymous »

Код: Выделить всё

permission = str(input("Would you like to take a quiz?\n")).lower()

if permission != "yes" and permission != "sure":
print("Aww okay, maybe next time?")
exit(0)
else:
questionAnswer = input("Great! Do you know what keyword if and else make together?\n").lower()
if questionAnswer == "elif":
secondQuestion = input("Correct! Now, what does print do?\n").lower()
else:
secondQuestion = input("Incorrect, what is a integer?\n").lower()
# noinspection PyUnboundLocalVariable
if secondQuestion == "it prints a statement":
print("Correct! You scored 2/2 on this test.\n")
elif secondQuestion.lower() == "a whole number":
print("Correct! You scored a 1/2 on this test.\n"
Когда я меняю "" в начале if, то независимо от того, что я ввожу, я получаю ответ
"Ой, ладно, может быть, в следующий раз?"
Когда я пытался переключиться мое «или» на «и» сработало? Я не понимаю...

Подробнее здесь: https://stackoverflow.com/questions/781 ... -in-line-3

Вернуться в «Python»