def my_function_name():
#Function code
//Calling it
my_function_name()
Using Parameters
def my_function_name(my_variable1, my_variable2):
#Function code
//Calling it
my_function_name(21, "abc")
my_function_name(my_variable1=21, my_variable2="abc")
my_function_name(my_variable2="abc", my_variable1=21)
Default values
def my_function_name(my_variable1, my_variable2="abc"):
#Function code
//Calling it
my_function_name(21)
my_function_name(21, "def")
Return values
def my_function_name():
return 21
//Calling it
return_value = my_function_name()
Multiple return values
def my_function_name():
return 21, "abc", 55
//Calling it
return_value_1, return_value_2, return_value_3 = my_function_name()
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.