File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55in an interesting way.
66"""
77
8+ def without_parameters ():
9+ """A function that does not accept parameters and does not return a value.
10+
11+ This function is not used in this module, but it is defined to illustrate
12+ that functions do not need to accept parameters or return values.
13+ """
14+ print ("This function does not accept parameters or return a value." )
15+ def sum (x : int , y : int ) -> int :
16+ """A function that accepts parameters and has type hints.
17+
18+ This function is not used in this module, but it is defined to illustrate
19+ that functions can accept parameters and have type hints.
20+ """
21+
22+ return x + y
823
924def add (x , y ):
1025 """Add two objects together to produce a new object.
@@ -55,6 +70,11 @@ def main():
5570 # attribute! Remember this - everything in Python is an object
5671 assert "includes this docstring!" in sum_until .__doc__
5772
73+ # Call the other two functions to ensure they work as expected
74+
75+ assert without_parameters () is None
76+ assert sum (1 , 2 ) == 3
77+
5878
5979if __name__ == "__main__" :
6080 main ()
You can’t perform that action at this time.
0 commit comments