Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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!