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 trialHend Elshaarawi
434 PointsI don't get it, I don't know what to do :c
Can someone help me, I feel like I'm lost...
print("Hello")
print("World!")
print("Let's do some math!")
print(5 + 3)
print("Thanks for playing along!')
1 Answer
nicole lumpkin
Courses Plus Student 5,328 PointsHey Elshaarawi! First I would reset the challenge to restore to the default values. Let's break this down line by line.
print("Hello")
There is nothing wrong with this line so leave it as is.
print(name)
This would raise an exception(error) because name is not defined. You can either turn it into a string by surrounding it with quotes, or you can define name on a line previous to the print statement
# option 1
name = 'nicole'
print(name)
#option2
print('name')
next line
print("Let's do some math!")
print(5 + "a")
There are no errors in the first line, however in the second line you cannot add and integer with a string, so you should convert 5 to a string.
print('5'+ 'a')
And finally, the use of double and single quotes is problematic in Python. You may define a single string with one or the other but not both.
print("Thanks for playing along!')
#option1
print("Thanks for playing along!")
#option2
print('Thanks for playing along!')
Jason Anders
Treehouse Moderator 145,860 PointsJason Anders
Treehouse Moderator 145,860 PointsNicely Answered! :)
nicole lumpkin
Courses Plus Student 5,328 Pointsnicole lumpkin
Courses Plus Student 5,328 Points:)