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

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,652 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,652 Points

Happy to help, keep going you got this!