`import math`

We’ve just imported a namespace. Its methods and attributes must still be accessed through the parent, `math`

.

```
math.sqrt(256)
```

`from math import *`

Now we’ve imported a collection of functions, not methods.

```
sqrt(256)
```

Test cases…

```
=============================== RESTART: Shell ===============================
>>> from math import *
>>> sqrt(256)
16.0
>>>
=============================== RESTART: Shell ===============================
>>> import math
>>> sqrt(256)
Traceback (most recent call last):
File "<pyshell#147>", line 1, in <module>
sqrt(256)
NameError: name 'sqrt' is not defined
>>> math.sqrt(256)
16.0
>>>
```

Mind, the above (`import *`

) uses up a tonne of resources and is not the most advisable approach. It does teach us that we can import a function from the math module.

```
from math import sqrt
```

Now the global namespace has a newly added function that is accessible from any scope in the program. And it does not take up a lot of room.

`import`

takes a comma separated list if we wish to merge a group of methods with our namespace. That way it only takes one statement.

```
from math import sqrt, sin, cos
```

Now we can go to town on trig.