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

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

Im mentally beaten by something that looks simple

creating_functions.py
def hello_student(name):
    return 'Hello ' + name

hello_student(hello)

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,441 Points

Hey Kennedy Malonga, let’s break it down:

  • Call the hello_student() function...

The function hello_student() expects a str argument. So the call to the function would look like hello_student(“Kennedy”)

  • and save the return value to a variable called hello.

Since the function returns a string, it may be assigned to a variable using hello = hello_student(“Kennedy”)

Post back if you need more help. Good luck!!!

thanks for the help Chris Freeman i understood what was my mistake after you broke it down