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

Jerry Gomez
Jerry Gomez
5,778 Points

how do I solve errors.py question

errors.py

  1. print("hello")
  2. print(name) 3. 4.print("Let's do some math") 5.print(5+"a")
errors.py
print("Hello")
print(name)
name error
print("Let's do some math!")
print(5 + "a")
type error
print("Thanks for playing along!')
print("Thanks for playing along!")

1 Answer

Mohammad Usman
Mohammad Usman
5,969 Points

Hi It looks like you forgot to assign a string to the variable called name. Furthermore, print(5 + 'a') will cause an error because you're trying to concatenate an integer and a string . Also, the last print statement opens with a double quote marks but ends with a single quote mark. Your code should look like the following:

print("Hello")
name = "Your name"
print(name)
print("Let's do some math!")
print("5" + "a")
print("Thanks for playing along!")