File tree 4 files changed +25
-0
lines changed
ch11-modules-and-packages/2-working-with-packages/packages_exercises
4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Ch 11.2 - Working With Packages
2
+ # __init__.py - Part of solution to Exercise 1
Original file line number Diff line number Diff line change
1
+ # Ch 11.2 - Working With Packages
2
+ # helpers/math.py - Part of solution to Exercise 1
3
+
4
+
5
+ def area (length , width ):
6
+ return length * width
Original file line number Diff line number Diff line change
1
+ # Ch 11.2 - Working With Packages
2
+ # helpers/string.py - Part of solution to Exercise 1
3
+
4
+
5
+ def shout (string ):
6
+ return string .upper ()
Original file line number Diff line number Diff line change
1
+ # Ch 11.2 - Working With Packages
2
+ # main.py - Solution to Exercise 2
3
+
4
+ from helpers .string import shout
5
+ from helpers .math import area
6
+
7
+
8
+ length = 5
9
+ width = 8
10
+ message = f"The area of a { length } -by-{ width } rectangle is { area (length , width )} "
11
+ print (shout (message ))
You can’t perform that action at this time.
0 commit comments