Please try to get your netID set up by next class (Lecture 2, 2025-02-01) so that you can access the lab computers.
I have posted the solutions for the additional tasks (1, 2, 2.5, and 3) on the Unit 1 solutions page (also linked above). The key for the Unit 1 solutions is bumblebee.
I have posted the first assignment on the course site. You can access it from the course site homepage, or go directly here: Assignment 1
Once you download Python, you should have IDLE installed on your computer. For information on using IDLE, see the “Learn something new” PDF file from Lecture 1 above.
Lecture 2
Agenda
Agenda
Some additional checks:
Attendance (checked at 30 minutes into lecture)
Check status of netIDs
Discuss Python access on home computers for assignments
Discuss assignment 1
Submission method: copy code into text box, don’t submit a file
Getting the length of a list or string using the len function
How to get the maximum or minimum element in a list or range using a for-loop
How to get the sum or total count of elements that satisfy a certain criteria (e.g., characters that are vowels) in a list or range using a for-loop
How to add elements to a list using the append method
How to get user input with the input function
Information:
If you didn’t finish the “Apply what you learned” questions in class, please take some time to finish them on your own. They won’t be graded, but finishing these questions will make you more prepared for the assignments, which are graded.
The Unit 1 assessment is due next week on February 8th at 11:59 PM. Please try to work on it soon so that you aren’t rushing to complete it.
The solutions for the “Apply what you learned” section of class, and the additional tasks, are on the Unit 2 solutions page (also linked above). The key for the Unit 2 solutions is swordfish.
I have posted the second assignment on the course site. You can access it from the course site homepage, or go directly here: Assignment 2
If you don’t have a netID, email the course coordinator to get it sorted out. Please try to have your netID ready by next lecture so we can all use the computers in the classroom.
If you don’t have access to a device running Windows at home, you can use this link to figure out how to download Python and IDLE so that you can complete the homework assignments: Python 3.10 downloads page. Scroll to the bottom of the page to see the downloads for your operating system.
Lecture 3
Agenda
Agenda
Attendance (checked at 30 minutes into lecture)
Check status of netIDs
Office hours poll
Discuss assignment 1 (again)
Reminder: due midnight tonight
Submission method: copy code into text box, don’t submit a file
Don’t need to submit output
Answer any questions on assignment 1
Discuss assignment 2
Submission method: only text-box submissions allowed, please indent code!
Discuss grading timeline
Will wait to grade assignment until late deadline (1 week from assignment due date)
The Unit 1 assessment was due last night at 11:59 PM:
If you need to submit late, email me your code.
There is one week for late submissions. Submissions after February 15th at 11:59 PM will not be accepted.
The Unit 2 assessment is due next week on February 15th at 11:59 PM.
The solutions for the “Apply what you learned” section of class, and the additional tasks, are on the Unit 3 solutions page (also linked above). The key for the Unit 3 solutions is tortoise.
I have posted the third assignment on the course site. You can access it from the course site homepage, or go directly here: Assignment 3
Office hours are now on Sunday from 1 PM to 2 PM. See the Brightspace page for the Zoom link.
Lecture 4
Agenda
Agenda
Reminder: office hours Sunday 1-2PM
Attendance (checked at 30 minutes into lecture)
Discuss assignment 2
Reminder: due midnight tonight
Submission method: copy code into text box, please indent code!
Don’t need to submit output
Answer any questions on assignment 2 and assignment 3
Discuss assignment 4 - available today
Discuss grading - assignment 1 to be graded Sunday
No more additional tasks, work on HW instead
Begin unit #4
Note: ignore problem #1 in the Apply what you know section, we already did it
importing modules (other Python files), importing specific items from modules
the random module
the join string method
running a function multiple times with different inputs to simulate something, and getting the average or some other metric related to the function results
converting strings and ranges to lists
the range object
the set object
the defaultdict object
Information:
The late deadline for the Unit 1 assessment is tonight at 11:59 PM:
If Brightspace doesn’t let you submit late, email me your code.
Submissions after tonight (February 15th) at 11:59 PM will not be accepted.
The Unit 2 assessment is due tonight at 11:59 PM.
If you need to submit late, email me your code.
There is one week for late submissions. Submissions after February 22nd at 11:59 PM will not be accepted.
The solutions for the “Apply what you learned” section of class are on the Unit 4 solutions page (also linked above). The key for the Unit 4 solutions is hummingbird.
I have posted the fourth assignment on the course site. You can access it from the course site homepage, or go directly here: Assignment 4
Office hours are tomorrow (Sunday) from 1 PM to 2 PM. See the Brightspace page for the Zoom link.
Lecture 5
Agenda
Agenda
Attendance (checked at 30 minutes into lecture)
Discuss assignment 3
Reminder: due midnight tonight
Submission method: copy code into text box, please indent code!
Answer any questions on assignment 3 and assignment 4
Computer filesystems: folders/directories and files
Python’s os module:
os.listdir
os.path.join
os.path.isdir
Recursion: functions that call themselves
Base case vs. recursive case
Equivalence of recursion and loops
Slicing (review) - negative indices
String endswith method
List sort method
Tuples
Sorting an iterable to create a unique key for dictionary lookups
Information:
The solutions for the “Apply what you learned” section of class are on the Unit 5 solutions page (also linked above). The key for the Unit 5 solutions is dromedary.
I have posted the fifth assignment on the course site. You can access it from the course site homepage, or go directly here: Assignment 5
Lecture 6
Agenda
Agenda
Attendance (checked at 30 minutes into lecture)
Discuss assignment 4
Reminder: due midnight tonight
Submission method: copy code into text box, please indent code!
Answer any questions on assignment 4 and assignment 5
Using (file = open(filename) ... file.close() instead of with open(filename) as file: ...)
List comprehension
Reading files from the internet with urllib.request
Storing Python objects for later use with shelve
Information:
The solutions for the “Apply what you learned” section of class are on the Unit 6 solutions page (also linked above). The key for the Unit 6 solutions is armadillo.
I have posted the sixth assignment on the course site. You can access it from the course site homepage, or go directly here: Assignment 6
Lecture 7
Agenda
Agenda
Attendance (checked at 30 minutes into lecture)
Mid-semester survey released on Brightspace
Discuss assignment 5
Reminder: due midnight tonight
Submission method: copy code into text box, please indent code!
Answer any questions on assignment 5 and assignment 6
Defining a function that returns another function (question 2 in the “Apply what you learned” section)
String formatting using .format(...)
Printing using the keyword arguments sep= and end=
Information:
The mid-semester survey is available on Brightspace. I have fixed a setting, so it should now be accessible to everyone. Please fill it out!
The solutions for the “Apply what you learned” section of class are on the Unit 7 solutions page (also linked above). The key for the Unit 7 solutions is crocodile.
I have posted the seventh assignment on the course site. You can access it from the course site homepage, or go directly here: Assignment 7
Lecture 8
Agenda
Agenda
Attendance (checked at 30 minutes into lecture)
Discuss mid-semester survey results
Extra lectures:
How computers work
Intro to data structures and algorithms
How programming languages work
Per feedback, will try to spend more time on lecture than on in-class exercises, and spend more time explaining concepts
Discuss assignment 6
Reminder: due midnight tonight
Submission method: copy code into text box, please indent code!
Answer any questions on assignment 6 and assignment 7
Creating GUIs (graphical user interfaces) with Tkinter
The entire lecture was spent on this topic. If you didn’t make it to lecture, please review the above PDFs of lecture materials and make sure you do the exercises. You will be using Tkinter to do the Unit 8 assessment, and per the “minimum credit” rule discussed in class, you need to at least draw a window and have some related content appear to get any credit for the assessment.
Information:
The solutions for the “Apply what you learned” section of class are on the Unit 8 solutions page (also linked above). The key for the Unit 8 solutions is groundhog.
I have posted the eighth assignment on the course site. You can access it from the course site homepage, or go directly here: Assignment 8
Lecture 9
Agenda
Agenda
Attendance (checked at 30 minutes into lecture)
Discuss assignment 7
Reminder: due midnight tonight
Submission method: copy code into text box, please indent code!
Answer any questions on assignment 7 and assignment 8
I am going to deviate from the provided materials going forward because I want to lecture on things that will be more entertaining and less difficult
Lecture 9 will cover turtle graphics
We will be doing everything from the “Lecture and exercises” PDF linked below - the exercises are interspersed throughout the lecture, rather than being provided separately. This should make for a more fluid classroom experience
I won’t provide solutions to the exercises, as we will be going through them together in class
Assignment 9 will be available tonight - the material it contains will depend on what we cover in class
Brief introduction to regular expressions with the re Python module
Information:
There are no solutions provided for Unit 9 - we went through the first 5 exercises in class, which should be more than sufficient to prepare you for the assignment.
I have posted the ninth assignment on the course site. You can access it from the course site homepage, or go directly here: Assignment 9
Lecture 10
Agenda
Agenda
Attendance (checked at 30 minutes into lecture)
Lecture topic for today: Pygame
Discuss assignment 8
Reminder: due midnight tonight
Submission method: copy code into text box, please indent code!
Answer any questions on assignment 8 and assignment 9
Begin lecture #10
Resources
Lecture 10 resources:
Examples (Python files, require pygame module to run):