I think there's an error in one of the Python string lessons

Hello, I am going through the Python 2 course and I believe my syntax is correct. It looks identical to the “solution”. I will upload screen shot but here’s the link

https://www.codecademy.com/courses/learn-python/lessons/strings--console-output/exercises/and-now-for-something-completely-familiar

Thanks in advance for your help.

Well, problem solved: I told it to “copy the solution” or something like that and, even though it looks just like my answer, it worked.

print() is a function and needs parens.This changed in Python 3. (along with other changes)
ex:

my_string = "cat"
print(len(my_string))
print(my_string).upper()

Yes, I realize this is python 2, but that’s deprecated.

Edit: I thought there was a bug in the lesson…but I tested and both python 2 and 3 answers work.

Also, as a general rule, please don’t mark your own answers in the forums as solutions.

Doesn’t it look like my answer and the solution are identical? The same thing happened in another lesson.

I didn’t have any issues with my code as written in Python 2 or 3.

Did you copy the solution or write your own code? Sometimes the code “behind the scenes” is picky. That’s all I’ve got.

I first typed my own code, then copied it over when I couldn’t get the program to let me progress; however, what they copied over looked just like my written code.

Thanks for your help.

1 Like