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

Shane Smith
seal-mask
.a{fill-rule:evenodd;}techdegree
Shane Smith
Python Development Techdegree Student 2,550 Points

Not sure what im doing wrong here :(

Not really sure what this questions is asking as I cant call the previous function I created without passing an argument into it correct?

I'm lost

challenge is in the top right corner with my broken code :)

1 Answer

Hi Shane Smith,

This is the solution.

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

And if I understood your question. Yes, if a function has a parameter you can't call it without passing an argument.

Shane Smith
seal-mask
.a{fill-rule:evenodd;}techdegree
Shane Smith
Python Development Techdegree Student 2,550 Points

Thank you for your response but I should have been more clear. Its part two of the challenge that I am not grasping. I had gotten as far as your code but not any farther.

Thank you!

Shane Smith,

Oh my bad. I now understand your confusion. The question is kinda misleading ( for a beginner ) "Call the hello_student() function and save the return value to a variable called hello." It doesn't say pass an argument or anything. But yeah, that's the solution if you need it :).

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

hello = hello_student("jassim")