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 understand this. What am I missing in this code?

I am not sure what I need to add. I have been trying for a while.

creating_functions.py
def hello_student(Hello):

    return hello_student

2 Answers

You need to return the string 'Hello' followed by the parameter. What you're doing is returning the function's name...., here's an example:

def example(eg):
    return 'Hello ' + eg
Megan Amendola
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree seal-36
Megan Amendola
Treehouse Teacher

Hi! Let me walk through the challenge:

  • Write a function called hello_student. - You did this correctly, nice work!
  • This function should receive one argument, name. - Your function is receiving one argument right now called Hello instead of name
  • This function should return one value, the string 'Hello ' followed by the value of the name parameter. - Your function is returning itself because you are returning hello_student which is the name of the function. Instead, you should be returning a string with both the word 'Hello ' and the name parameter with a space between the two. Here's a video to remember string formatting.

Let me know if you still need help :)