Import a Toolbox: Modules
A module is a toolbox of code that you can use in your own program. Someone has already written, tested and improved a function for the square root, for rolling a die, for the median of a list and for the number of days between two dates. In this course you import the math, random, statistics and datetime modules, use their tools to solve small everyday problems, and learn the ways of importing. A lesson on finding and choosing tools shows how to look inside a module with dir and help, how to read an import error, and which mistakes make an import fail. A dice laboratory is the project at the end: you roll a die hundreds of times and see how fair it is. The practice runs your code and tells you which results are wrong.