CISC-121 Plan/Record

Monday Tuesday Thursday

20210906

     Labour Day

20210907

Demo Code:

Notes:

Not According to Plan

20210909

Demo Code:

Egyptian Multiplication

Notes:

Python - First Look

20210913

Demo Code:

 

Notes

Python - loops and stuff

20210914

Demo Code:

Equals vs Is

Summary:

We spent the class talking about how Python keeps track of the various values it needs during a program's execution.  We learned about mutable and immutable objects.

 

20210916

Demo Code:

Lists

Summary:

We discussed many of the powerful built-in functions for manipulating lists, and some errors that are particularly easy to make.

20210920

Demo Code:

Python Functions

Summary:

The demo code contains comments explaining which feature of Python functions is being demonstrated in each of the sample functions.

20210921

Demo Code:

 

Notes

20210923

Demo Code:


These Python source files are annotated with descriptive comments.

Summary:

Through the five versions of this simple GUI demonstration we looked at some basic Tkinter functionality.  We introduced :
  • event-driven programming
  • "import"
  • Label, Entry, Text and Button widgets
  • pack layout and grid layout
  • "float" and "str"
  • sys.exit()
  • "try" and "except"
  • tkinter font operations

20210927

Demo Code:

20210928

Demo Code:

20210930

Demo Code:

20211004

Demo Code:

 

Summary:

We discussed recursion as a way of thinking about solving problems by reducing every problem instance to a smaller instance of the same problem.

20211005

Demo Code:

 

Summary:

This example demonstrates how thinking recursively can lead to algorithms that are quantitatively superior to iterative algorithms for the same problem.

In this case, the recursive algorithm computes the desired result using far fewer steps than the simple iterative method.

20211007

Demo Code:

 

Summary:

The demo code includes notes on some important points:

  • improving efficiency of recursive programs by avoiding time-consuming copy operations
  • using a helper function to start the recursion cleanly
  • why we should never trust the user
  • how we can protect against the user's errors by making things simple for them.

 

The demo code also contains an implementation of Binary Search, one of the most famous and useful recursive algorithms.  We did not get to this in class but we will work through it on Monday 20211017

Bonus Material:

Here are two Python programs presenting a recursive solution to the well-known "Towers of Hanoi" puzzle:

 

The second program demonstrates using tkinter for very simple 'animation'

20211011

      Thanksgiving

20211012

     Fall Break

20211014

     Fall Break

20211018

Demo Code:

 

Bonus Material:

 

20211019

MIDTERM EXAM

20211021

Demo Code:

20211025

Demo Code

20211026

Demo Code

20211028

20211101

Notes for the week:

20211102 20211104

20211108

20211109

20211111

20211115

20211116

Demo Code

20211118

20211122

Demo Code

20211123 20211125

20211129

Demo Code

20211130

20211202

     
Taxonomy