Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Functions, Packing, and Unpacking Getting Info In and Out of Functions Functions with Arguments and Returns

Write a function called hello_student. This function should receive one argument, name. This function should return one

i dont het it ;-;

1 Answer

Josh Keenan
Josh Keenan
19,529 Points

For the first part of the challenge it wants something that looks like this:

def hello_student(name):
    return "Hello " + name

The first line defines the function hello_student and we are giving it one parameter, which is name. A parameter is what we call anything we are saying a function should be passed.

Next we are returning the string "Hello {name}" which is what the challenge wants to see returned, we are just concatenating the strings (adding strings together to make a different string).

The next part of the challenge wants you to create a variable, and then call the function and pass in your name, remember you have to pass it in as a string which means you'll need "" around it. You got this!

thank you for explaining this to me i am greatfull for your help. cheers. Blue

Josh Keenan
Josh Keenan
19,529 Points

Happy to help, keep going you got this!