when function in python code example
Example 1: create function in python
def myFunction():
print('I am running in a function!')
Example 2: python funtion
def nameOfFunction(something):
return something
Example 3: function used in python
def hello():
name = str(input("Enter your name: "))
if name:
print ("Hello " + str(name))
else:
print("Hello World")
return
hello()