Python Programming


Python is a general-purpose, versatile and popular programming language. It’s great as a first language because it is concise and easy to read, and it is also a good language to have in any programmer’s stack as it can be used for everything from web development to software development and scientific applications. This course covers the basics of the language syntax and usage, as well as advanced features such as objects, generators, and exceptions.

Course Outline

  1. Introduction
    • Welcome
    • Understanding prerequisites for Python
  1. Python Quick Start
    • Getting started with “Hello World”
    • Selecting code with conditionals
    • Repeating code with a loop
    • Reusing code with a function
    • Creating sequences with generator functions
    • Reusing code and data with a class
    • Greater reusability with inheritance and polymorphism
    • Handling errors with exceptions
  1. Setting Up Python
    • Installing Python 3 and Eclipse
  1. General Syntax
    • Creating a main script
    • Understanding whitespace in Python
    • Commenting code
    • Assigning values
    • Selecting code and values with conditionals
    • Creating and using functions
    • Creating and using objects
  1. Variables, Objects, and Values
    • Understanding variables and objects in Python
    • Distinguishing mutable and immutable objects
    • Using numbers
    • Using strings
    • Aggregating values with lists and tuples
    • Creating associative lists with dictionaries
    • Finding the type and identity of a variable
    • Specifying logical values with True and False
  1. Conditionals
    • Selecting code with if and else conditional statements
    • Setting multiple choices with elif
    • Understanding other strategies for multiple choices
    • Using the conditional expression
  1. Loops
    • Creating loops with while
    • Iterating with for
    • Enumerating iterators
    • Controlling loop flow with break, continue, and else
  1. Operators
    • Performing simple arithmetic
    • Operating on bitwise values
    • Comparing values
    • Operating on Boolean values
    • Operating on parts of a container with the slice operator
    • Understanding operator precedence
  1. Regular Expressions
    • Using the re module
    • Searching with regular expressions
    • Replacing with regular expressions
    • Reusing regular expressions with re.compile
  1. Exceptions
    • Learning how exceptions work
    • Handling exceptions
    • Raising exceptions
  1. Functions
    • Defining functions
    • Using lists of arguments
    • Using named function arguments
    • Returning values from functions
    • Creating a sequence with a generator function
  1. Classes
    • Understanding classes and objects
    • Using methods
    • Using object data
    • Understanding inheritance
    • Applying polymorphism to classes
    • Using generators
    • Using decorators
  1. String Methods
    • Understanding strings as objects
    • Working with common string methods
    • Formatting strings with str.format
    • Splitting and joining strings
    • Finding and using standard string methods
  1. Containers
    • Creating sequences with tuples and lists
    • Operating on sequences with built-in methods
    • Organizing data with dictionaries
    • Operating on character data with bytes and byte arrays
  2. File I/O
    • Opening files
    • Reading and writing text files
    • Reading and writing binary files
  1. Databases
    • Creating a database with SQLite 3
    • Creating, retrieving, updating, and deleting records
    • Creating a database object
  1. Modules
    • Using standard library modules
    • Finding third-party modules
    • Creating a module
  1. Debugging
    • Dealing with syntax errors
    • Dealing with runtime errors
    • Dealing with logical errors
    • Using unit tests
  1. Building a Database
    • Application Normalizing a database interface
    • Deconstructing a database application
    • Displaying random entries from a database