O'Reilly logo

Python for Kids by Jason R. Briggs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Useful Python Modules

As you learned in Chapter 7, a Python module is any combination of functions, classes, and variables. Python uses modules to group functions and classes in order to make them easier to use. For example, the turtle module, which we used in previous chapters, groups functions and classes that are used to create a canvas for a turtle to draw on the screen.

When you import a module into a program, you can use all of its contents. For example, when we imported the turtle module in Chapter 4, we had access to the Pen class, which we used to create an object representing the turtle’s canvas:

>>> import turtle
>>> t = turtle.Pen()

Python has a lot of modules for doing all sorts of different tasks. In this chapter, we’ll ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required