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

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

boi
boi
14,242 Points

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?