03-Methods and Functions
03-Methods and Functions
Progress in Python
def Keyword
● Creating a function requires a very specific syntax,
including the def keyword, correct indentation, and
proper structure.
● Let’s get an overview of a Python function
structure.
def name_of_function():
>> name_of_function()
Resulting Output
>> Hello
def name_of_function(name):
’’’
Docstring explains function.
’’’
print(“Hello ”+name)
>> print(result)
>> 3