Mix 'n' Match


#1

Why is it saying to make sure to have value for all 5 variables?


# Use boolean expressions as appropriate on the lines below!

# Make me false!
bool_one = (2 <= 2) and "Alpha" == "Bravo"  # We did this one for you!



# Make me true!
bool_two = (100/5 == 100/6) or "home" == "home"

# Make me false!
bool_three = (100/2 == 200*800) and "des"=="des"

# Make me true!
bool_four = (600/2 > 500/2) or "lo "=="lo "

# Make me true!
bool_five = (1*8 == 83*1) not "mec"=="me"

#2

Your last expression is not valid, so that is where to look for the problem.


#3

For bool_five it is saying “Make me true” and you did the opposite it should be (83 > 18) not “mec” == “me”


#4
# Make me true!
bool_five = (1*8 == 83*1) not "mec"=="me"

Something to keep in mind concerning NOT…

A not B

is not a valid expression. When there are two operands there must be a binary operator between them. not is an unary operator that takes only one operand.

A and not B

satisfies both rules. To make the above (bool_five) expression true we just have to modify it slightly.

1 * 8 == 83 * 1  is False

"mec" == "me"  is also False

Consider that False and False and False or False both yield False. not False is True, so,

not (False and False)  =>  True

not (False or False)   =>  True

Now just fill in the two expressions.


#5

this is what you should write for bool_five
bool_five = (1 * 8 == 83 * 1) or not “mec”==“me” you missed “or” .


#6

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