Weekly Modules
- Course Content: Overview of Course Topics, and detailed Learning Outcomes.
- Lectures are being recorded; see side-bar for link.
Week 1: Introduction (Sept 4 - 6)
Details...
- Required Readings
- For week #1, do the Runestone readings and interactive exercises at the following links.
- For best results, set aside 15-30min to read them and do the exercises before each class. The instructor may ask questions from the textbook, so please try to read them well. Enjoy!
- Friday's Class
- Resetting previous text-book progress:
If you have taken this class before, you may be prompted to log into Runestone. This term, we are using the publicly available textbook, and no login is required. Clear your browser's cache for the Runestone website if you continue to be prompted to log in.
- Notes
- Wed, Sept 4th lecture recording (from Zoom). Passcode:
awesome
- 0 - Administrative
- Fri, Sept 6th lecture recording (from Zoom) Passcode:
awesome
- 1 - Introduction
- Wed, Sept 4th lecture recording (from Zoom). Passcode:
- Lab: No lab this week
Work on getting the tools installed and working!- Install Python 3 for free (recent version, such as 3.12.x)
- Install VS Code
- Assignment 1: Part 1 posted! Get started now.
Week 2: Chat Systems (Sept 9 - 13)
Details...
- Required Readings
- Monday
- Wednesday
- 7.1 Boolean values and expressions
- 7.2 Logical Operators
- 7.4 Conditional execution: Binary Selection
- 7.5 Omitting the else clause: Unary selection
- 2.10 Reassignment
Note: The readings are grouped into tentative lecture orderings to help you to pace your reading. Depending on class dynamics, we might go a bit faster or slower.
- Notes
- 2.1 Chatbots with Personality
- 2.2 Chatbots with Personality
- Code:
simple_bot.py
, andbranch_bot.py
in solutions folder.
- Code:
- 2.3 Chatbots with Personality
- Code:
ifif_vs_elif.py
, andzodiac.py
in solutions folder.
- Code:
- [New] Examples from live lectures.
- Lab
- Assignment
- Assignment 1 due next week
Week 3: Chat Systems (Sept 16 - 20)
Details...
- Required Readings
- Monday
- 1.7 Syntax Errors
- 1.8 Runtime Errors
- 1.9 Semantic Errors
- 9.5 String Methods (except 9.5.1)
- 9.13 The in and not in operators
- 10.5 List Membership
- Wednesday
- 4.4 The for loop
- 4.5 Flow of Execution of the for Loop
- 4.7 The range function (except Turtle examples)
- 2.2 Values and Data Types
- 2.3 Type conversion functions
- 7.6 Nested Conditionals
- Monday
- Notes
- 3.1 Chatbots with Personality -
strip()
,lower()
,upper()
,in
.- Code:
fortune.py
, andbranch_bot.py
in solutions folder.
- Code:
- 3.2 Chatbots with Personality - Branching & Loops
- Code:
canadian_units.py
,in_string.py
, andmind_reading.py
in solutions folder.
- Code:
- 3.3 Chatbots with Personality - Self test questions
- 3.1 Chatbots with Personality -
- Code form In Lectures
- Academic Honesty presentation
- [NEW] Examples from live lectures
- Lab
- Assignment
- Assignment 1 due this week
Week 4: Chat Systems (Sept 23 - 27)
Details...
- QUIZ FRIDAY: In-class, on-paper, multiple-choice quiz covering assignment 1 content.
- Required Readings
- Monday
- 2.2 Values and Data Types (review of Integers and Floats)
- 2.3 Type conversion functions
- 2.7 Operators and Operands (review)
- 2.9 Order of Operations
- 2.10 Reassignment (review)
- 2.11 Updating variables
- Wednesday
- 6.5.1 The Accumulation Pattern (activity func-4-6 only)
- 9.5.1 String Format Method
- 10.3 List Length
- Monday
- Notes
- 4.1 Chatbots - Loops & Conversion.
- 4.2 Recommender Systems - Loops, Conversions
- Code:
happy_newyear.py
,list.py
,menu.py
,type_conversions.py
in solutions folder.
- Code:
- Code form In Lectures
- [NEW] Examples from live lectures
- Lab
- Assignment
Week 5: Recommender Systems (Oct 1 - 4)
Details...
- No class Monday.
- Required Readings
- Wednesday
- 9.8 String Comparison
- 10.4 Accessing Elements in a List
- 10.6 Concatenation and Repetition for Lists
- 10.8 Lists are Mutable
- 10.24 Nested Lists
- 11.1 Working with Data Files
- 11.2 Finding a File on your Disk
- 11.3 Reading a File
- 11.4 Iterating Over Lines in a File
- Friday
- Wednesday
- Notes
- 5.1 Recommender Systems - Working with Files.
favourites.csv
data file in solutions folder.file_test.py
,dog_vs_cat.py
file examples in the solutions folder.
- 5.2 Recommender Systems - Split, Nested Loops.
- [NEW] 5.3 Recommender Systems - Self Test
- 5.1 Recommender Systems - Working with Files.
- Code form In Lectures
- [NEW] Examples from live lectures
- Lab
- Assignment
Week 6: Recommender Systems (Oct 7 - 11)
Details...
- Required Readings
- Monday
- 9.6 Length of strings
- 9.9 Strings are Immutable
- 9.11 Traversal by index
- 9.14 Accumulation of strings
- End of reading material for Midterm.
- Monday
- Notes
- Code form In Lectures
- [NEW] Examples from live lectures
- Lab
- Assignment
- Assignment 2 is due Tuesday!
- Assignment 3.
Week 7: Recommender Systems (Oct 14 - 18)
Details...
- Classes on TUESDAY, Wednesday, and Friday
- Required Readings
- Notes
- Code form In Lectures
- [NEW] Examples from live lectures
- Lab
- Assignment
Week 8: Recommender Systems (Oct 21 - 25)
Details...
- Required Readings
- Monday
- Wednesday
- 6.1 Functions
- 6.4 Local Variables (ignore return statement for now)
- 6.11 Turtle Bar Chart
- Notes
- Friday is the midterm; see info page.
- 8.1 Turtle graphics and Functions
- Sample Code for Turtle, Functions, and Dictionaries.
- Code form In Lectures
- [NEW] Examples from live lectures
- Lab
- Assignment
- Assignment 3 is due Monday.
Week 9: Recommender Systems (Oct 28 - Nov 1)
Details...
- Required Readings
- Monday
- 6.2. Functions that Return Values
- 6.4 Local Variables (review, now with knowledge of return)
- 6.5 The Accumulator Pattern (review, now with knowledge of return)
- 6.6 Functions can call other functions
- 6.7 Flow of Execution Summary
- Wednesday
- Monday
- Notes
- Code form In Lectures
- [NEW] Examples from live lectures
- Lab
- Assignment
- Assignment 4 is due end of next week.
Week 10: Image Processing (Nov 4 - 8)
- Required Readings
- Monday
- 8.11. Two-Dimensional Iteration: Image Processing (Note: The Runestone textbook image processing is analogous but slightly different from what we will use and is required in the course, which is provided in the cmpt120images module. Follow the readings for the theory.)
- 10.24 Nested Lists
- Wednesday
- 5.1. Modules and Getting Help (Revisited)
- 5.2. More about using modules
- 5.3 The Math Module
- 5.5 Creating Modules
- 10.8. Lists Are mutable
- Monday
- Notes
- 10.1 Graphics - Images
- 10.2 Graphics - Nested Loops
- Starting Code and Files for Images
-
cmpt120image.py
: Image manipulation module (custom). - Images: download ZIP file of all images, or download one at a time in this folder of images.
- Code: sample Python code for working with images (shown in notes)
-
- If you have troubles installing
pygame
andnumpy
using the command
pip install pygame numpy
(perhaps a "TK version" error), then see the last point in the resources page.
- Code form In Lectures
- Posted after lectures.
- Lab
- Assignment
- Assignment 4 is due Sunday.
- Assignment 4 is due Sunday.
Week 11: Image Processing (Nov 11 - 15)
- Required Readings
- Monday
- No class for Remembrance Day.
- Wednesday
- 10.10. Objects and References
- 10.11. Aliasing
- 10.12. Cloning Lists (optional - fyi only)
- 10.13. Repetition and References (optional - fyi only)
- 10.16. Append versus Concatenate
- 10.19. Using Lists as Parameters
- 10.22. Functions that Produce Lists
- Friday
- 16.1 What is Recursion?
- 16.3 The Three Laws of Recursion
- 16.5 Visualizing Recursion
- 16.6 Sierpinski Triangle
- Monday
- Notes
- Coming soon.
- Code form In Lectures
- Posted after lectures.
- Lab
- Lab 10 coming soon.
- Assignment
- Project details coming soon.
Notes Related Info
- Posted notes are incomplete; watch content videos and attend lectures to fill in the blanks. Come to office hours to fill in missed content. Completed notes will not be published.
Privacy
Lectures will be recorded and made available via the course website. As a result, Simon Fraser University may collect your image, voice, name, personal views and opinions, and course work under the legal authority of the University Act and the Freedom of Information and Protection of Privacy. This information is related directly to and needed by the University to support student learning only (i.e., posting in the Learning Management System for students to review).