how to write and call the function in function python code example
Example 1: how to write a function in python
# We use the def keyword to write a function in python
# Format: def function_name():
# For example:
def Bark():
print("Bark! Bark!")
# If we want to run the function
Bark()
Example 2: function in function python
def function1(): # outer function
print ("Hello from outer function")
def function2(): # inner function
print ("Hello from inner function")
function2()
function1()