CP104: Notes and Lectures

These documents and videos provide information, help, and advice on CP104 topics.

These lectures are organized by topic, not by week - check the lab and assignment schedules as to when you should understand these topics.

Lecture attendance is not mandatory. Go through the notes and videos and bring your questions to lecture time.

Zybooks cover the same material. Their schedule is at Zybooks.

The Lectures

Notes Recorded Lectures Textbook Chapters/Sections
1: - Lesson 1: L01.php
Introduction
Using the Text Chapter 1 - Introduction to Computers and Programming
2: - Lesson 2: L02.php
Program Design 2.1 Designing a Program
Output with Python 2.3 Displaying Output with the print Function
Comments 2.4 Comments
Variables 2.5 Variables
Keyboard Input 2.6 Reading Input from the Keyboard
Calculations 2.7 Performing Calculations
Notes Constants 2.11 Named Constants
Lab 3: Formatted Output 2.10 Displaying Formatted Output with F-strings
3: - Lesson 3: L03.php
Notes Generalized Programming
5.9 The math Module
4: - Lesson 4: L04.php
Function Introduction 5.1 Introduction to Functions
5.2 Defining and Calling a Void Function
Function Parameters 5.5 Passing Arguments to Functions
Function Returns 5.7 Introduction to Value-Returning Functions: Generating Random Numbers
5.8 Writing Your Own Value-Returning Functions
Function Libraries 5.10 Storing Functions in Modules
5.6 Global Variables and Global Constants
5: - Lesson 5:
Simple Decisions 3.1 The if Statement
Complex Decisions 3.2 The if-else Statement
3.3 Comparing Strings
Nested Decisions 3.4 Nested Decision Structures and the if-elif-else Statement
Notes Logical Operators 3.5 Logical Operators
3.6 Boolean Variables
Notes Short Circuit Evaluations
Notes Fallthrough Algorithms
Notes Decision Problems
Lab 5: Decisions
6: - Reading Week
7: - Lesson 6:
Notes Loops: for 4.1 Introduction to Repetition Structures
4.3 The for Loop: A Count-Controlled Loop
Loops: for Running Total 4.4 Calculating a Running Total
8: - Lesson 7:
Loops: while 4.2 The while Loop: A Condition-Controlled Loop
4.5 Sentinels
4.6 Input Validation Loops
4.7 Nested Loops
Notes The Infinite while Loop
9: - Lesson 8:
Notes Lists: Introduction 7.1 Sequences
7.2 Introduction to Lists
Lists: Indexing 7.2 Introduction to Lists
Lists: Looping 7.2 Introduction to Lists
Lists: Slicing 7.3 List Slicing
Lists: Operators and Methods 7.4 Finding Items in Lists with the in Operator
7.5 List Methods and Useful Built-in Functions
Lists: Functions 7.6 Copying Lists
7.7 Processing Lists
10: - Lesson 9:
Notes Strings: Indexing, Looping, and Slicing 8.1 Basic String Operations
8.2 String Slicing
Strings: Operators and Methods 8.3 Testing, Searching, and Manipulating Strings
Strings: Functions
11: - Lesson 10:
Notes Files: Introduction 6.1 Introduction to File Input and Output
Files: Processing Lines 6.2 Using Loops to Process Files
Files: Processing Records 6.3 Processing Records
12: - Lesson 11:
Notes