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 trialMichael Kaminski
1,419 PointsI am having trouble returning the proper output from the function. I am not sure what I am doing wrong
I seem to be having trouble getting the variable hello assigned to the function. When I use a REPL in the workspace it checks out, so I am not sure that I am doing something wrong, though I get an error message when I go to check work.
def hello_student(name):
hello="Hello " + name
return hello
print(hello_student("name"))
1 Answer
Ronald Kratochwill
11,213 PointsI coded your function and it looks like it may be an indentation issue. Here is what I coded.
def hello_student(name):
hello = "Hello " + name
return hello
print(hello_student("Bob"))
Abdullah Aldughaimi
7,103 PointsAbdullah Aldughaimi
7,103 Pointsdef hello_student(name): return "Hello {}".format(name) print(hello_student("name"))
I hope this help