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 trialFaraz Jahangiri
1,028 Pointssaving the variable
I am trying to save the return value but every time I do that it just says 'Error'.
def hello_student(name):
return ('Hello ' + name)
hello_student()
2 Answers
Brandon White
Full Stack JavaScript Techdegree Graduate 35,771 PointsHi Faraz,
Two things. One) Make sure youβre saving the returned string to a variable named hello. And Two) Make sure you actually pass an argument (ie. your name as a string) into the hello_student function.
If that doesnβt work let me know.
boi
14,242 PointsI copy/pasted your code into the challenge and it gave me an error message "Bummer: TypeError: hello_student() missing 1 required positional argument: 'name'
instead of Error
The purpose of your function hello_student()
is similar to giving a shoutout like "Hello Faraz", so I think you are missing a positional argument in the function call just like what the error suggests "Bummer: TypeError: hello_student() missing 1 required positional argument: 'name'"
And once you get that sorted out, the challenge also requires you to store the function hello_student
into a variable
post back if the problem persists