Is this a human error or computer error? HELP PLEASE


#1



I honestly need help AS I DON'T KNOW where I'm going wrong....



Here is my error message:

File "python", line 10
** bool_three = "Eggs" != "Bananas" not "Cats" == "Dogs"**
** ^**
SyntaxError: invalid syntax


I was expecting to pass the exercise but I haven't...


# 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 = ((7 + 3) / 2) or (10 - 5)

# Make me false!
bool_three = "Eggs" != "Bananas" not "Cats" == "Dogs"

# Make me true!
bool_four = "Mary sue" != "Gary stu" or (10**3) != (20 % 51)

# Make me true!
bool_five = False and False

I'd appreciate if you would help me out if you wouldn't mind... :slight_smile:


#2

not cannot be used by itself between operands. It must be paired with and or or.

and not

or not

#4

@lamyh ,

What you have here works ...

# Make me true!
bool_two = ((7 + 3) / 2) or (10 - 5)

However, be sure to notice what value you are actually assigning to bool_two.

Let's print the value of bool_two ....

print bool_two

The output is ...

5

Viewed as a bool, 5 is equivalent to True, but is important to be aware that the actual value is 5. If you would like an explanation of why the result is 5, please let us know.


#5

Thank you! you are amazing!!! :smile:


#6

:grin: Thank you!!! You are awesome :slight_smile:


#7

ok, so I tried using you tip with pairing the not with something else; but it still has not worked? what do I do next in your opinion


#8

Never mind - I've figured it out now...


#10

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