- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreturnStatement.py
More file actions
Latest commit
22 lines (17 loc) · 528 Bytes
/
Copy pathreturnStatement.py
File metadata and controls
22 lines (17 loc) · 528 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'''
The return statement is used to return from a function, i.e break out of
the function. We can optionally return a value from the function as well.ArithmeticError
'''
defmaximum(x, y):
ifx>y:
returnx
elifx==y:
return'The numbers are equal.'
else:
returny
print(maximum(2, 3))
'''
Note: that a return statement without a value is equivalent to RETURN NONE
NONE is a special type in python that represents nothingness. Its used
to indicate that a variable has no value.
'''