Why am I getting an error?


#1

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

It says, File "python", line 13
bool_four = True and True
^
SyntaxError: invalid syntax

Also, when I take out line 13, it gives the same error code for line 16

Here's the code I type:

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 = not 10 != 9 and False

Make me false!

bool_three = len ("Helloo") == len("Alyssa)" or 9 == 5

Make me true!

bool_four = True and True

Make me true!

bool_five = False or True


#2

Did you mean?...

len("Alyssa")

My thought is the end quote is misplaced so that puts the closing ")" inside the string. Everything after this point (beginning at line 13?) might be getting included in the "len()" method, giving errors after that point.


#3

That is the incorrect syntax.

The " should be inside, for example ("Hello").


#4

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