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

Ryan Shah
PLUS
Ryan Shah
Courses Plus Student 239 Points

How can i fix these errors ?

How can i fix these errors Sir.. i make one variable a = 5 but this ain't working here so what should i do now..??

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

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

print("Thanks for playing along!')

2 Answers

Ronald Tse
Ronald Tse
5,798 Points

SIMPLE AFTER YOU UNDERSTAND THE QUESTION There are 3 things that you need to fix and you've fixed the first one.

For the second one, notice that you cannot add number with string. So you can change the string into a randome number

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

For the last one, read it carefully, just a stupid mistakes.

Hi Ryan,

You fixed the first 2 problems.

The error message you should be getting is SyntaxError: EOL while scanning string literal

This is from the last line. It means that it reached the End of the Line and never found the end of the string.

Hint: the string starts with a double quote.