Compare Closely! - Am I doing this right?


#1
# Assign True or False as appropriate on the lines below!

# Set this to True if 17 < 328 or to False if it is not.
bool_one = True   # We did this one for you!

# Set this to True if 100 == (2 * 50) or to False otherwise.
bool_two = True if 100 == (2 * 50) else False
print bool_two

# Set this to True if 19 <= 19 or to False if it is not.
bool_three = True if 19 <= 19 else False
print bool_three

# Set this to True if -22 >= -18 or to False if it is not.
bool_four = True if -22 >= -18 else False
print bool_four

# Set this to True if 99 != (98 + 1) or to False otherwise.
bool_five = True if 99 != (98 + 1) else False
print bool_five

This doesn't seem like the correct way to do it, yet it is letting me onto the next part. Is this correct?

# Assign True or False as appropriate on the lines below!

# (20 - 10) > 15
bool_one = False    # We did this one for you!

# (10 + 17) == 3**16
# Remember that ** can be read as 'to the power of'. 3**16 is about 43 million.
bool_two = (20 - 10) > 15

# 1**2 <= -1
bool_three = 1**2 <= -1

# 40 * 4 >= -4
bool_four = 40 * 4 >= -4

# 100 != 10**2
bool_five = 100 != 10**2

Same with the second one, this doesn't seem like this is what it wants me to do, however it is letting me go on. Is this the correct way?

Reason I am asking is because I am having trouble with the final problem in this chapter "The Big If" and I am trying to figure out why I don't know how to solve it.


#2

The intention is to assign the boolean values True/False to certain variable names. Look at the example - the line with the comment "We did this one for you!"

Also, most of the time it's just redundant to test if a boolean value is equal to True, the result of that test is going to be the same as the value of the boolean value itself.

So you would not do:

if ball_is_purple:
    print True
else:
    print False

Instead, you would do:

print ball_is_purple

#3

HI Guys, What's sideways? A Yorkshire Pudding! Ooooooohhh!


#4

who likes beans coz i dont