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,078 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

Jassim Al-Hatem
Jassim Al-Hatem
19,402 Points

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,078 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!

Jassim Al-Hatem
Jassim Al-Hatem
19,402 Points

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")