Get startedGet started for free

Different ways of importing

There are several ways to import packages and modules into Python. Depending on the import call, you'll have to use different Python code.

Suppose you want to use the function inv(), which is in the linalg subpackage of the scipy package. You want to be able to use this function as follows:

my_inv([[1,2], [3,4]])

Which import statement will you need in order to run the above code without an error?

This exercise is part of the course

Introduction to Python

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise