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

Luke Shephard Zikuyumo
Luke Shephard Zikuyumo
1,064 Points

Creating_functions

How to create a function hello_student and return name as a single parameter

creating_functions.py
def hello_student():
    val=hello+name
    return name
print(luke)

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 65,221 Points

Hey Luke Shephard Zikuyumo, you're almost there. Here's what missing:

  • :point_right: the function is missing the parameter name
  • :point_right: hello should be a quoted string using (" "), capitalized, and include a space
  • :point_right: Need to return the new string val not the parameter name
  • :point_right: The print(luke) is causing an error due to luke is not defined. This line can be deleted.

Post back if you need more help. Good Luck!!