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 trialJames Longoria
2,425 PointsFunctions, Packing, and Unpacking Task 1/2
I am not sure what is wrong here. I tried many different ways and keep getting the challenge wrong. I submitted this code and received the following:
"Bummer: AssertionError: None != 'Hello Ashley' : Whoops, it looks like the string returned from your function is incorrect. Double check spelling and make sure there is a space between words in the returned string."
def hello_student(name):
print('Hello ',name)
return
4 Answers
Steven Parker
231,275 PointsYou're close, but the function should return the string. You won't need to "print" anything.
Paul C
2,668 PointsJames I was wondering the same thing. I was trying it with my name, because it does not specify you need to use the instructors name, and it was not working.
I think because this course is new they are still sorting out the bugs. Eventually I came up with this solution:
def hello_student(name):
name = 'Ashley'
return 'Hello ' + name
#Note the space after the 'o' in 'hello'.
James Longoria
2,425 PointsFloyd, I did the same code except I left out line 2 and it accepted the solution.
The new challenges definitely lack some specifications but it has helped me learn by exhausting all my resources before throwing in the towel.
def hello_student(name):
return 'Hello ' + name
Steven Parker
231,275 PointsThe "name" is supplied as an argument, it should not be set to a fixed value inside the function.
Christopher Sullivan
4,230 Pointsdef hello_student(name): return "Hello " + name
hello = hello_student("Chris")
I found this to work for me.
Dennis Montegnies
1,112 PointsCan anyone explain me why
def hello_student(name):
return ('hello ', name)
is not accepted as a solution?
Steven Parker
231,275 PointsYou'll need to use concatenation or string formatting to join the parts. Separating two items with a comma in a "return" causes it to return a tuple instead of a longer string.
James Longoria
2,425 PointsJames Longoria
2,425 PointsI guess I read to much in to it, and being up for 18+ hours doesn't help. I solved the problem thanks for the help!