-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunction.py
More file actions
23 lines (18 loc) · 940 Bytes
/
Copy pathfunction.py
File metadata and controls
23 lines (18 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""The syntax of function definitions and function calls."""
def my_function(param_1: type_hint, param_2: type_hint) -> result_type:
"""
Short sentence describing the function.
The title of the so-called docstring is a short sentence stating
what the function does. It can be followed by several paragraphs of
text describing it in more detail. Then follows the list of
parameters, return values, and raised exceptions (if any).
:param param_1: the description of the first parameter (if any)
:param param_2: the description of the second parameter (if any)
:returns: the description of the return value (unless `-> None`).
"""
body of function 1
body of function 2
return result # if result_type is not None we return something
normal statement 1 # some random code outside of the function
normal statement 2
my_function(argument_1, argument_2) # We call the function like this.