Professional Documents
Culture Documents
Functions
Functions
Syntax of Function:
def function_name(parameters):
You need to use the def keyword, give your function a name,
followed by a pair of parentheses, and end the line with a
colon (:).
If your function takes arguments, the names of the arguments
(parameters) are mentioned inside the opening and closing
parentheses.
When you call the function with specific values for these
parameters, they're called arguments or actual parameters.
This is because the arguments in the function call are the
values used for the function's parameters.
def my_func():
my_func()
# Output
Hello! Hope you're doing well
def my_func(name,place):
my_func("Riya","India")
# Output
Hello Riya! Are you from
India?