Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics (2015) Python for Beginners Correct errors

Nathan Emily
Nathan Emily
494 Points

I am on the errors.py quiz and am not sure what is actually wanted out of this. I can not see errors.

I am currently viewing the Errors.py challenge but I do not see any errors listed. Nor do I have enough information on how to handle this challenge. How exactly do we solve this.

errors.py
print("Hello")
print(name)

print("Let's do some math!")
print(5 + "a")

print("Thanks for playing along!')

When you run that code it gives this error:

SyntaxError: EOL while scanning string literal

So you can start there

1 Answer

I agree, The challenge is very dumb and confusing. However there are three mistakes in the code that he wants you to fix: Firstly he tries to print(name), but name isnt assigned to anything. Assign name to something to fix that. Secondly he tries to add 5 and "a", this is not possible either, turn 5 into a string to fix that. Finally the bottom print is using a " on the left side of the string and a ' on the right side. Fix that.

Hope this helps!