Introduction to Algorithmic Problem Solving using Python

Instructor: John B. Schneider

This course provides an introduction to computer programming where it is assumed you have no prior programming experience. The Python programming language is used to present various constructs that are present, in one form or another, in nearly all the major computer languages. Python is used because it is generally easier to learn than most other languages and yet it is truly an "industrial strength" language used throughout industry and academia.

Topics to be covered include: data type, assignment, arithmetic, input and output, type conversion, functions, strings, lists, loops, file manipulation, conditional statements, objects, modules, recursion, and dictionaries. Having mastered the material in this course you will be able to implement Python programs to solve any number of problems (including some truly challenging ones!). Furthermore, having learned this material, you will be much better prepared to learn other languages such as C and Java.

Unit 0:

Unit 0 Video 1: Welcome & Course Overview

A broad-brush overview of the course.

Length: 5:48

Unit 0 Video 2: Computers & Information: One to Three Bits

Here we show how a small collection of ones and zeros can represent useful information.

Length: 7:36

Unit 0 Video 3: Computers & Information: Arbitrary Number of Bits

Discussion of how larger collections of bits (i.e., ones and zeros) can be used to represent text,

pictures, and sound.
Length: 8:23

Unit 0 Video 4: Computers & Computation

A brief introduction to how a computer performs computations.

Length: 7:41

Unit 0 Video 5: Computer Languages

A discussion of some of the difficulties with "natural languages" and why they are

not appropriate for computer languages.
Length: 5:48

Unit 0 Video 6: Installing Python on a Mac

Instructions for installing Python on a Macintosh.

Length: 9:30
(Coming Soon)

Unit 0 Video 7: Installing Python on a Windows PC

Instructions for installing Python on a Windows PC.

Length: 8:10

Unit 1:

Unit 1 Video 1: Comments and the print() Function

Demonstration of the use of the print() function, the use of comments, and an introduction to strings.

Length: 5:37

Unit 1 Video 2: Bugs

Discussion of the types of "bugs" and demonstration of what happens when a bug is in Python code.

Length: 7:30

Unit 1 Video 3: print() and the newline Character

Further exploration of the print() function together with some syntax related to function arguments.

Also, a discussion of the newline character.
Length: 7:11

Unit 1 Video 4: Multiple Statements per Line, Keyboard Shortcuts & Optional Arguments

Writing multiple statements on a line; using keyboard shortcuts in IDLE; and the use of optional arguments.

Length: 5:52

Unit 1 Video 5: Obtaining Help

The built-in help() function call tips.

Length: 5:54

Unit 1 Video 6: Interactive Environment vs. Interpreting a File

Exploration of the some of the differences between running code interactively and running code from a file.

Length: 9:27

Unit 1 Video 7: Unit 1 Summary

Summary of the Unit 1 material.

Length: 6:18

Unit 2:

Unit 2 Video 1: Data Type & Literals

Discussion of data, type, and literals (where data is entered directly into the computer code).

Length: 5:56

Unit 2 Video 2: Literal Strings

Discussion of literals in the form of strings.

Length: 6:20

Unit 2 Video 3: Literals Integers

Discussion of literals in the form of integers.

Length: 6:16

Unit 2 Video 4: Literals Floats

Discussion of literals in the form of floats.

Length: 9:46

Unit 2 Video 5: The type() Function

Here we introduce the type() function which returns the type of its argument.

Length: 4:55

Unit 2 Video 6: Expressions & Basic Arithmetic

Numeric literals are used to construct simple arithmetic expressions.

Length: 5:49

Unit 2 Video 7: Operators & Operands

Discussion of the operators and their associated operands.

Length: 5:34

Unit 2 Video 8: Precedence

Here we consider how precedence determines the order of operation when an expression has more than one operator.

Length: 7:23

Unit 2 Video 9: Multi-line Expressions

Demonstration of the construction an expressions that span more than one line.

Length: 7:00

Unit 2 Video 10: Multi-line Strings

Demonstration of the construction strings that span more than one line.

Length: 8:21

Unit 2 Video 11: Mixed-type Expressions

Here we consider what happens when an expression involves operands that have different types.

Length: 6:16

Unit 2 Video 12: Expressions as Arguments

Demonstration that expressions can be used as the arguments to functions.

Length: 4:28

Unit 2 Video 13: Unit 2 Summary

Summary of the Unit 2 material.

Length: 8:14

Unit 3:

Unit 3 Video 1: Assignment Operator

Introduction to the assignment operator.

Length: 6:36

Unit 3 Video 2: Assignment vs. Equal

Discussion of the ways in which the assignment operator differs from the equal sign used in math classes.

Length: 5:59

Unit 3 Video 3: Valid Identifiers

Presentation of the rules that govern what constitutes a valid identifier.

Length: 8:08

Unit 3 Video 4: Underscore in the Interactive Environment

A quick note that the single underscore has a special mean in the interactive environment: it contains the result of the last expression

that was not assigned to a variable.
Length: 1:48

Unit 3 Video 5: Namespaces

An introduction to namespaces and a slightly more detailed discussion of what happens in Python when we use the assignment operator.

Length: 3:26

Unit 3 Video 6: Cascaded & Simultaneous Assignment

Discussion of cascaded assignment and simultaneous assignment.

Length: 6:20

Unit 3 Video 7: Exponentiation

Demonstration of the arithmetic exponentiation operator.

Length: 4:41

Unit 3 Video 8: Modulo & divmod() Function

Discussion of the modulo operator and the divmod() function which combines the floor division and the modulo operator.

Length: 5:04

Unit 3 Video 9: Augmented Assignment

Demonstration of the use of augmented assignment which provides a shorthand when updating a variable based on its old value.

Length: 5:43

Unit 3 Video 10: Unit 3 Summary

Summary of the Unit 3 material.

Length: 7:34

Unit 4:

Unit 4 Video 1: Obtaining Input

Discussion of how the input() function is used to obtain input from the user.

Length: 5:35

Unit 4 Video 2: Converting Data to an Integer

The int() function converts its argument to an integer.

Length: 7:42

Unit 4 Video 3: Converting Data to a Float

he float() function converts its argument to a float.

Length: 4:25

Unit 4 Video 4: Evaluating Strings

Discussion of the use of the eval() function in the context of obtaining input

Length: 5:35

Unit 4 Video 5: A Pace Calculator

Tying together many of the tools and concepts that have been presented to obtain a program that calculates pace when given a distance and time.

Length: 7:55

Unit 4 Video 6: Unit 4 Summary

Summary of the Unit 4 material.

Length: 5:00

Unit 5:

Unit 5 Video 1: Functions: Why Functions?

Overview of the reasons programs are typically written in terms of functions.

Length: 7:03

Unit 5 Video 2: Void Functions

Demonstration of the behavior of void functions which do not return anything useful but instead have side effects.

Length: 6:17

Unit 5 Video 3: Non-Void Functions

Demonstration of the behavior of non-void functions which do have meaningful return values.

Length: 3:01

Unit 5 Video 4: Creating Non-Void Functions

Discussion and demonstration of the creation of non-void functions.

Length: 9:11

Unit 5 Video 5: Functions with multiple arguments and return values

Here we demonstrate how simple it is to create function that have multiple arguments and return multiple values.

Length: 5:22

Unit 5 Video 6: Creating Void Functions

Discussion and demonstration of the creation of non-void functions.

Length: 7:13

Unit 5 Video 7: print() vs. return

Explanation of the fact that the print() function doesn't return anything and return statements don't print anything.

Length: 5:06

Unit 5 Video 8: Unit 5 Summary

Summary of the Unit 5 material.

Length: 2:51

Unit 6:

Unit 06 Video 1: Docstring and help() with Functions

Discussion of how a string literal can be placed in the body of a function to help document what that function does.

Length: 5:32

Unit 06 Video 2: Scope: Local Variables

We introduce the notion of scope and show how variables defined in a function only exist within that function.

Length: 7:37

Unit 06 Video 3: Scope: Global Variables

We continue to explore the notion of scope by considering global variables, which are variables defined outside of functions.

Length: 10:22

Unit 06 Video 4: Scope: Functions

Here we demonstrate that scope pertains to functions in a similar way to how it pertains to variables.

Length: 5:31

Unit 06 Video 5: Organizing Programs: main()

Demonstration of the construction of a program that is organized in terms of functions and uses a function called main() as the starting point for execution.

Length: 10:10

Unit 06 Video 6: Optional Parameters

Here we show how to create functions with optional parameters.

Length: 7:05

Unit 06 Video 7: Unit 6 Summary

Summary of the Unit 06 material.

Length: 3:07

Unit 7:

Unit 07 Video 1: Introduction to Objects

We start to discuss some of the previously hidden power of Python that's offered via object-oriented programming.

Length: 4:18

Unit 07 Video 2: The class Statement and Attributes

A discussion of the use of a class statement to provide a blueprint for creating objects.

Length: 5:37

Unit 07 Video 3: The class Statement & Methods

We expand the use of the class statement so that functions can be associated with objects.

Length: 5:21

Unit 07 Video 4: The dir() function

We demonstrate that the dir() function provides a listing of a given object's attributes and methods.

Length: 3:07

Unit 07 Video 5: Objects in Python

Description: Although it hasn't been mentioned before, as demonstrated here, it turns out that everything in Python is an object.

Length: 5:25

Unit 07 Video 6: The __init__() Method

We employ the __init__() method in a class statement so that we can assign values to an object's attributes when the object is created.

Length: 6:59

Unit 07 Video 7: Operator Overloading

Here we show that operation performed by operators (i.e., symbols) is really contingent upon the types of the operands.

Length: 3:39

Unit 07 Video 8: Unit 07 Summary

Here we summarize the rather simple "take away"

Length: 2:16

Unit 8:

Unit 08 Video 1: Introduction to Lists

We introduce the list data type which allows us to collect data into a single entity.

Length: 5:49

Unit 08 Video 2: List Methods

Here we explore four of the methods that Python provides for working with lists.

Length: 8:00

Unit 08 Video 3: For Loops and Accumulators

We discuss for-loops which, among other things, provide a convenient way to access all the elements in a list and to accumulate data.

Length: 11:27

Unit 08 Video 4: Indexing

To access the individual elements of a list, we can use explicit index as is discussed here.

Length: 6:46

Unit 08 Video 5: The range() "Function"

Here we start to explore the range() function which is quite useful despite the fact that it merely generates a sequence of integers.

Length: 11:46

Unit 08 Video 6: More on the range() "Function"

We demonstrate how the range() function can be used to generate the indices for the elements of a list.

Length: 7:32

Unit 08 Video 7: Mutability, Immutability, and Tuples

We show the various ways in which lists and tuples are the same and the one important way in which they differ, i.e.,

lists are mutable and tuples are immutable.
Length: 7:40

Unit 08 Video 8: Loops within Functions

Here we demonstrate how a programming construct that has a header and body can be embedded in another programming

construct that also has a header and body.
Length: 6:16

Unit 08 Video 9: Unit 08 Summary

Summary of the list and loop material presented in this set of videos.

Length: 5:56

Unit 9:

Unit 09 Video 1: Nested for-loops

Here we show how one for-loop can be nested in the body of another for-loop.

Length: 12:23

Unit 09 Video 2: Lists of Lists

Since lists can be elements of a list, we demonstrate the construction of a list of lists and show how to access the elements of such a structure.

Length: 6:18

Unit 09 Video 3: Simultaneous Assignment

Simultaneous assignment can be used in the header of a for-loop and, as shown here, this feature can be used to write loops such that the code is quite self-descriptive.

Length: 5:18

Unit 09 Video 4: zip() & enumerate()

The built-in functions zip() and enumerate() simplify the implementation of various looping constructs as discussed in this video.

Length: 6:16

Unit 09 Video 5: Lists and Namespaces

Here we depict what happens in a namespace when various statements are issued that involve lists.

Length: 4:04

Unit 09 Video 6: Sequences

Sequences are a special kind of iterable where one can use an integer index to specify a particular element of the sequence. As discussed here, list, tuples, and strings are all sequences.

Length: 6:31

Unit 09 Video 7: Negative Indices

Previously we only considered non-negative integers when accessing elements of a sequence. Here we show that one can also use negative integers to specify elements of a sequence.

Length: 5:10

Unit 09 Video 8: Slices

We demonstrate how slices can be used to obtain a subset of elements from a sequence.

Length: 8:01

Unit 09 Video 9: More Slices

In this video we demonstrate using a slice and also demonstrate that a slice of a list produces an entirely new list.

Length: 5:31

Unit 09 Video 10: Even More Slices

As discussed here, in addition to specifying a start and stop value, a slice can incorporate an increment, which may be negative.

Length: 4:29

Unit 09 Video 11: Slices as lvalues

In this video we show that a slice can appear on the left side of the assignment operator provided an iterable is given on the right side.

Length: 6:13

Unit 09 Video 12: List Comprehensions

We show that list comprehensions provide a convenient way to construct a new list that otherwise would need to be assembled using an accumulator and a for-loop.

Length: 7:44

Unit 09 Video 13: Unit 09 Summary

Brief summary of the material presented in this set of videos.

Length: 4:53