Python 3 /Python-control-flow/exercises/boolean-variables

https://www.codecademy.com/courses/learn-python-3/lessons/python-control-flow/exercises/boolean-variables

Why is it, that the Instruction get a green checkbox for exercise complete, but there is still a syntax error present.

Here is the code (line 1 & line 2):

my_baby_bool_two = True
py print(type(my_baby_bool_two))

and here is the error code:

File "script.py", line 2
    py print (type(my_baby_bool_two))
           ^
SyntaxError: invalid syntax

Still the checkbox goes green, like if I did everything right. How can that be?

I have no idea what the instructions told you to type (as I cannot access the lesson). Were you told to type py in your code? py is what throws the error anyway. Seems unnecessary and py doesn’t exist in python syntax (unless someone wants to correct me on that).

2 Likes

I have noticed py to be present in that position from time to time in several of the instructions (various courses.) I always thought it was an editing tag that didn’t get removed. Anyway, if it’s there, remove it and the error will clear

3 Likes

Interesting. First time I’ve seen it. Thanks for letting me know. :slight_smile:

2 Likes