CommencerCommencer gratuitement

Importing from parents

In this exercise, you will be importing a function from the utils.py module at the top of your package. A utils module is usually used for small, often unrelated, pieces of code each of which which aren't enough to justify their own module.

You'll import a function for checking the units passed to the convert_units() function. You'll use this checking function in another subpackage later. That's why we don't just put this function in one of the modules in the length subpackage.

Remember that you can open/close the folder and files overview by clicking on the icon on the left side of the editor highlighted in red. Icon with multiple files

Cet exercice fait partie du cours

Developing Python Packages

Afficher le cours

Exercice interactif pratique

Passez de la théorie à la pratique avec l’un de nos exercices interactifs

Commencer l’exercice