Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Functions, Packing, and Unpacking Getting Info In and Out of Functions Functions with Arguments and Returns

when i run the code ... i get bummer message but when I preview its correct

''' def hello_student(name): return name

print("Hello {}".format(hello_student('Ashley Judd')))

creating_functions.py
def hello_student(name):
    return name


print("Hello {}".format(hello_student('Ashley Judd')))

2 Answers

Megan Amendola
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree seal-36
Megan Amendola
Treehouse Teacher

Hi! All of this code should be happening inside of the function. This function should return the string 'Hello ' followed by the value of the name parameter. Right now, the function is only returning the name. The "Hello {}".format( should be inside the function.

Victor Curtis Jr
Victor Curtis Jr
5,268 Points

Well if you're trying to do challenge 1, then you just need to return "Hello" and the name of the student. It looks like here you are trying to print it out which you necessarily don't have to do. you could try:

def hello_student(name):
    return ("Hello {}".format(name))