what does def in python mean code example
Example 1: how to use def in python
def functionName(variable):
//function content
Example 2: explain def in python
def greet(name):
"""
This function greets to
the person passed in as
a parameter
"""
print("Hello, " + name + ". Good morning!")
Example 3: what does * mean in python in functions
>>> numbers = [2, 1, 3, 4, 7]
>>> more_numbers = [*numbers, 11, 18]
>>> print(*more_numbers, sep=', ')
2, 1, 3, 4, 7, 11, 18