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

Richard Andison
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Richard Andison
Python Development Techdegree Graduate 13,211 Points

Hello. Im having some trouble on the second section. I am a confused as to how to set the "hello" variable properly. TY

Cheers!

creating_functions.py
def hello_student(name):
    hello = "Hello " + name
    return hello

2 Answers

Josh Keenan
Josh Keenan
19,652 Points

In Python you can save the result of running a function within a variable:

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

hello = hello_student("Tommy")

So it wants you to create a variable and save the result of running your function there. Hope this helps!