Python Basics: Modules and Packages (Exercises)
00:10 I will read the exercises and the challenge to you, but you can also find them in the PDF that you can download in the materials below this video. After finishing this course, it’s a good idea to tackle them in the next few days.
That way, you can strengthen what you learned and come back to a specific lesson of this course when you need a refresher. Here is the first exercise. Create a module called
greeter.py that contains a single function,
And here is a challenge. This challenge is a bit more involved than the review exercises because you should build an entire package yourself. Here are the details: In a project folder called
package_exercises/, create a package called
helpers with three modules:
calc.area() to print the following output:
THE AREA OF A 5-BY-8 RECTANGLE IS 40. Or maybe I should scream this part because it’s uppercase? No, I think it’s better for your ears this way.
02:32 The return string should be in uppercase letters. All right, these are two exercises and one challenge that you can do for yourself on your computer. If you are feeling motivated, you can tackle them right away.
Become a Member to join the conversation.