if question3.lower == "moral" or "ethical" or "religious" or "political":
print("Good job ")
score=+1
else:
print("That was incorrect. Did you actually pay attention to what you read? ")
print("The answers that would have been accepted is either, moral, ethical, Religious or Political ")
question4=input(" How many COs were there? ")
if question4=="16,000" or "16000":
print("Good job ")
print(" ")
score=+1
else:
print("That was incorrect. Read more carefully from now on ")
print(" ")**
P.S the question part says it right no matter what
How do I fix this?
if question3.lower == “moral” or “ethical” or “religious” or “political”:
To
if question3.lower() == “moral” or question3.lower() == “ethical” or question3.lower ()== “religious” or question3.lower() == “political”:
And change this line
if question4==“16,000” or “16000”:
To
if question4 == “16,000” or question4 == “16000”:
As the users above have said, this line is wrong. It comes out to the python side looking like this:
(question3.lower == "moral") or bool("ethical") or bool("religious") or bool("political")
# Since the strings are not empty, bool will always return true, so in the end, it will always be true
As @UMARismyname said, I recommend using “in” instead.
This very term reminds me of a guy on Discord, he had a massive ego and would always criticize Python beginners and say stuff like “Your code’s not pythonic” or something along those lines and thought he was genuinely cool.