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 Functions, Packing, and Unpacking Getting Info In and Out of Functions Functions with Arguments and Returns

I don't know where I'm going wrong.

It says that the function is not outputting "Hello Ashley" correctly, I am not really sure how to go about this.

creating_functions.py
def hello_student(name):
    greeting = print('Hello', name)
    return greeting

hello_student("Ashley")

2 Answers

Steven Parker
Steven Parker
231,248 Points

The function should create a combined string using concatenation, and return that string.
You won't need to "print" anything.

And just for general info, "print" doesn't return anything useful for an assignment.

Hudson Lanier
Hudson Lanier
6,329 Points

Hey Mishaal,

I think the problem is with the comma between 'Hello' and name. Try a plus sign instead of a comma.

This will work too: greeting = "Hello {}".format(name) Also: greeting = "Hello" + name