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

tyler borg
tyler borg
9,429 Points

It doesn't specify what argument to pass into the function for the second question on this quiz...

"Call the hello_student() function and save the return value to a variable called hello."

4 Answers

Kevin Pham
Kevin Pham
4,627 Points

Hello,

'Write a function called hello_student. This function should receive one argument, name. This function should return one value, the string 'Hello ' followed by the value of the name parameter.'

The argument that you're trying to pass in is 'name'.

name in this case is ambiguous so you can give it whatever value, but it looks like it prefers a string.

tyler borg
tyler borg
9,429 Points

It was for the question that said this: Call the hello_student() function and save the return value to a variable called hello.

You can pass any string argument. The purpose is to pass the argument to your function, and assign the returned value to the variable 'hello'. The exact argument you're passing doesn't matter. So you can pass the argument hello_student("Tyler") or "asdf" or any string you want.

Kevin Pham
Kevin Pham
4,627 Points

Oh, for that part, if you haven't already, Assign a value to 'name' before you call the function. You can assign the variable 'hello' to the function call itself since it returns something. Here's a general idea of what it should look like

<your already existing function here from task 1/2>

name = "insert your own name here"

hello = <function call with correct argument>

Hope this helps!