Question -
Answer -
You can define functions to provide the required functionality. Here are simple rules to define a function in Python:
(1) Function blocks begin with the keyword def followed by the function name and parentheses (( ))
(2) Any input parameters or arguments should be placed within these parentheses. You can also define parameters inside these parentheses.
(3) The first statement of a function can be an optional statement-the documentation string of the function or docstring.
(4) The code block within every function starts with a colon (:) and is indented.
(5) The statement return [expression] exits a function, optionally passing back an expression to the caller. A return statement with no arguments is the same as return None.