def my_function():
print("hello")
print("bye")
my_function()Functions with Parameter
my_function(var1,var2):
print(var1)
print(var2)- In this example, ‘var1’ and ‘var2’ are parameters
- When you call the function with 2 variables, those are called argument
Default Argument
my_function(var1="merhaba"):INFO
When passing arguments to the function, you can specify the parameter name to not mess up the order.
my_function(var1='deneme')Return
In order to have an output of a function, you should return something
- “Return” finishes the function