When given a formula, do I need to change the format in the python courses?


#1

update: I am adding an example

I copied and pasted the asnwers for the AND operator from the original instructions. Was an additional step supposed to have been implemented?

click here


How do I use the order of operations of the conjuction operators (true, or, etc) when a parentheses is included?
#2

Set bool_one equal to the result of:

False and False

the result of False and False is obviously False, so you should set bool_one to False:

bool_one = False

you should manually evaluate to conditions to ensure you understand them, and then set the variable to the appropriate Boolean value. Unfortunately, the exercise does not enforce this in its validation.


#3

So do I need to change the following (this is a follow up)

-(1 ** 2) < 2 ** 0 and 10 % 10 <= 20 - 10 * 2

to what the actual outcome would be?
My question is, do I read the first number as (-1) to the power of 2 or (-1 to the power of 2)

I am making sure I am understanding these instructions correctly - I dont understand the formatting…

ohhhhh… so I evaluate the first one as either true or false and then the second one as either true or false.


#4

yes, and the outcome is a Boolean value which you then assign to the variable. You have to do this for all 5 variables, i did the first one for you, as an example

the math between parentheses should be solved first, but if you really don’t know, you can do:

print -(1 ** 2)

see the outcome and work backwards how the maths is done


#5

Are the correct answers:

bool_one = false

bool_two = false

bool_three = false

bool_four = true

bool_five = true

or, for example:

-(-(-(-2))) == -2 and 4 >= 16 ** 0.5 == false

…and so on


#6

yes, except Boolean values always start with a uppercase letter in python (True, False).


#7

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