Python Control Flow



The exercise asks you to do the following:

Set the variable statement_one equal to the results of the following boolean expressions:

Statement one:

(2 + 2 + 2 >= 6) and (-1 * -1 < 0)

I have entered the following code:

statement_one = (2 + 2 + 2 >= 6) and (-1 * -1 < 0)

and it returns False.

As both boolean expressions are True I expected True to be printed. However, I believe it’s returning false because -1 isn’t being accepted as a negative number.

Just wondering why this isn’t working as expected?

Thanks in advance :slight_smile:


you misread the instructions, but i see many people make that mistake

you need to set the variable to the result, so if you think (2 + 2 + 2 >= 6) and (-1 * -1 < 0) you should set statement_one to false:

statement_one = False

unfortunately the exercise validation doesn’t enforce this, but it would be good to manually evaluate the conditions to learn evaluating conditions

please solve this math for me step by step:

(-1 * -1 < 0)

so i can see where you go wrong


This is a major facepalm moment! -1 x -1 = 1 and is therefore greater than 0!

I’m clearly overthinking everything and making silly mistakes! But thanks again for helping out.


yep, good catch

do you now also understand what the best way to solve the exercise?

Sure, doing statement_one =(2 + 2 + 2 >= 6) and (-1 * -1 < 0) will get you to pass, but its not the best way to go if want to get the best out of the lesson. Manually evaluate the condition, then set the variable to the result.


@gurpal89, you can give me the url of this exercise?


Hi @stetim94 the url for this exercise is:


ah, its part of the computer science course, that explains why i couldn’t find it. Thank you :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.