← back to unit
Easy
# basics functions
Parameters: Passing Information In
A parameter lets you hand information into a function when you call it:
def greet(name):
print(f"Hello, {name}!")
greet("Sam")
prints: Hello, Sam!
Your turn: we've already read a name into name for you. Define a function greet(name) that prints f"Hello, {name}!", then call greet with name.
💡 need a hint?
pyb-func-params.py🔒 given lines are locked — write your code in between
loading...