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

Armando Garcia
Armando Garcia
4,252 Points

def hello_student(name): print("Hello ", name) Im not sure how this is incorrect for the directions given

so it says to write a function hello_student and the argument passed should be name, and it should return the printed statement of "hello" followed by the name variable. Ive tested this on PyCharm and it works no problem, but the test wont let me continue without it

creating_functions.py
def hello_student(name):
    print("Hello ", name)

2 Answers

The challenge requires 2 things from your solution, the first is to print out a string not a tuple, the second, it wants you to return the value not print it.

your solution does the opposite, your output is a tuple not a string.

def hello_student(name):
    print("Hello ", name)

#Output
>>> ("Hello ",  "name")

Output should be "Hello name" not ("Hello ", "name"). Tag me if you need me to show you the complete solution.

Armando Garcia
Armando Garcia
4,252 Points

Thank you so much, your a gem lol. I knew there was some minor detail I was overlooking in the question itself. I just could not figure it out for some reason.

Bro i still not get it 😕

Armando Garcia
Armando Garcia
4,252 Points

What does your function look like MJ?