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

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.

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