Hello there!
I was working on some Python 3 practice questions in the Codecademy Go app, and I’m stuck with this question:
I thought the answer would be the second option, but according to the app, the correct answer is the following (which is hidden in the screenshot):
if age <= 15 and height <= 65 and rollercoaster != "Cyclone":
I don’t really get the explanation for my wrong answer. Why shouldn’t the logical operator and
be inverted? Shouldn’t A and B and C
negated be not A or not B or not C
? I’m thinking of De Morgan’s Law… am I getting something wrong here?
Any help would be much appreciated. Thanks!