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?