Python provides many functions that we can call . For example, previously we called the function type in order to determine the type of a value. We will analyze the function call, see more built-in functions, and take a look at the Python documentation that lists and describes the available functions.

A module contains Python code. There are modules in the Python Standard Library that we can import and then use. We can also write our own modules to perform computation or do specific tasks.

Lecture Prep

Watch:
  1. Built-In Functions (6 minutes) These functions are always available. You can find all the built-in functions and their description, on the Python Documentation page .
  2. Module-Based Functions (3 minutes) Besides the built-in functions, you can get access to many other functions by importing modules . We will use the math module as an example.
  3. Python Documentation (5 minutes) Python documentation has a very specific format. Let's learn the format so that we can understand the documentation.
  4. Modules (4 minutes) A module is a file that stores Python code.
  5. Module Structure (6 minutes) How is a module organized? In addition to Python code, we show two different ways to write comments .

Also read: 3.1 - 3.3 , 2.4


Lecture Materials

Slides: Individual slides for viewing , 6-up layout for printing

Examples: my_module.py , fah2cel.py , script.py , script2.py
        To download the above files, right-click (Windows) or command-click (Macs) on the filename and then select "Save link as". This way you choose where the files will be saved, instead of having your computer save to the default folder (from which you will later have to move your files for organization).

Questions and Answers: check the answers after you try them on your own!

Link to Lecture Recording