Get startedGet started for free

Exposing functions to users

Now that your impyrial package has some useful code and is properly organized, it is time to use import structures to expose the functions to users.

Currently, the only function you want to make easily available to users is the convert_unit() function inside the module impyrial/length/api.py.

In this exercise, you'll write import statements so that the package can be imported and used like this:

import impyrial

result = impyrial.length.convert_unit(6, 'ft', 'yd')

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

This exercise is part of the course

Developing Python Packages

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise