Conditional & Control Flow "AND"


#1

Link below:
https://www.codecademy.com/courses/python-beginner-BxUFN/2/2?curriculum_id=4f89dab3d788890003000096#

Provision:
The boolean operator "and" returns True when the expressions on both sides of "and" are true.
The Question:
I'm just looking to confirm my math with someone to make sure i'm not crazy.
I'm evaluating the code from below as follows:

-(1**2) = -1 ; 2**0 = 1 ; therefore -1 < 1 which is TRUE

10% of 10 = 1 (10*0.1 = 1) ; 20 - 10 * 2 = 20 - 20 which is 0; therefore 1 <= 0 which is FALSE

bool_four has 1 True value and 1 False value, making the statement False? Therefore should the answer be False and not True? I changed my answer on the linked page so i could progress, but am i missing something or is the math provided wrong?

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

#2

........yea

% is the remainder from division not "percent"

:stuck_out_tongue_closed_eyes:


#3
-1 < 1  => True
0 <= 0  => True

#4

I am having the same problem

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

if i true either true or false it does not work


#5

You should not include this in your response. It's meant to be visually evaluated. Just write, True.


#6

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