How to do this problem


#1

How do I code conditionals and control flow? It's a bit complex to me.


#2

Could you copy the instructions, so I can tell you what exactly you have to do :slightly_smiling:


#3

Or

The boolean operator or returns True when at least one expression on either side of or is true. For example:

1 < 2 or 2 > 3 is True;
1 > 2 or 2 > 3 is False.

Instructions

Time to practice with or!

Set bool_one equal to the result of 2**3 == 108 % 100 or 'Cleese' == 'King Arthur'
Set bool_two equal to the result of True or False
Set bool_three equal to the result of 100**0.5 >= 50 or False
Set bool_four equal to the result of True or True
Set bool_five equal to the result of 1**100 == 100**1 or 3 * 2 * 1 != 3 + 2 + 1

#4

So what you have to to is:

bool_one = (2**3 == 108%100 or "Cleese" == "King Artur")

You see 2**3 is 8 and 108%100 is also 8, which means, this part is True, "Cleese" isn't the same as "King Artur", which means it's False
So the result of this is, that bool_one is True, because one of the components is True

bool_two = (True or False)

so you set the variable bool_one, bool_two (..) to the things written there.


#5

Make sure that the_flying_circus() returns True

def the_flying_circus():
if (64 > 10 and 55 > 11):
return True
elif (64 > 10 or 55 > 10):
return True
else:
return True

print the_flying_circus()