basic function in python code example
Example 1: python functions
# first we have to write 'def'
# then our function name followed by ()
# and a ':' abd defining block of code
def multiply(): # naming convention could be same as variable for functions
product = 10.5 * 4
return product
product = multiply()
print(product)
Example 2: create function in python
def myFunction():
print('I am running in a function!')