- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocstrings.py
More file actions
Latest commit
29 lines (21 loc) · 634 Bytes
/
Copy pathdocstrings.py
File metadata and controls
29 lines (21 loc) · 634 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'''
Python has a feature called docstrings. Docstrings are used to help document
the program better and makes it easier to understand.
'''
defprint_max(x, y):
'''prints the max of two numbers
The two values must be integers.'''
# convert to integers, if possible
x=int(x)
y=int(y)
ifx>y:
print(x, 'is the max')
else:
print(y, 'Is the max')
print_max(3, 5)
print(print_max.__doc__)
'''
There are two advantages one, being the function is easier since we dont need
to worry about the numbr of arguments. Two, we can give values to only those
parameters to which we want.
'''