To the faculty page of James Tam Return to the course web page

CPSC 217: Course outline fall 2023

Index (shortcut to major sections of the webpage)

 

A brief overview of the programming language (python) you will learn

 

Course administration (grading, textbooks, the course instructor's contact information)

Day/Time

Lectures will be held live during the scheduled day/time (passcode for both = hope)
  • L01, MWF 10 AM SB103
  • L02, MWF 1 PM CHC105

Instructor contact Information

James Tam

Official office time: Monday 11:30 AM - Noon, Wednesday 2:10 - 2:50 PM.

 

Email: tam@ucalgary.ca (Make sure you specify the course name and number in the subject line)

   
General information Official course information sheet (summary of official course requirements). The course information sheet applies to both lectures.

 

General assignment information

Grade calculator to estimate your term grade: [Excel spreadsheet]

Academic misconduct vs. collaboration: what is allowed for this class

Practice assignments: They won't be for credit but they're extra problems that you can try in order to improve your programming and problem solving skills

Official recommended textbook "Python for everyone: 3rd edition" (Cay S. Horstmann, Rance D. Necaise) Wiley, 3rd edition. 

 

Link to other UC licensed textbooks Also you can search the UC library website [Link 1] or [Link 2]  for 'free' python eTexts (requires authentication).

Tutorial information (teaching and help tutorials)

Teaching tutorials (all are located in MS317)

 

Tutorial

Instructor name

Contact information: if your questions are short then you can use email otherwise please bring your questions to the CT/Help Tutorial

T04 MoWe 12:00PM - 12:50PM Farajpour, Niloufar  (User of MAC-OS) niloufar.farajpour@ucalgary.ca
T05 TuTh 8:00AM - 8:50AM Md, Jaber Al Nahian (Windows user) mdjaberal.nahian@ucalgary.ca
T06 TuTh 9:00AM - 9:50AM Sandykbayeva, Danissa (Windows user) danissa.sandykbay1@ucalgary.ca
T07 TuTh 12:00PM - 12:50PM Sidratul, Montaha (Windows user) sidratul.montaha@ucalgary.ca
T08 TuTh 1:00PM - 1:50PM Meghji, Safeena (User of Windows, MAC-OS) safeena.meghji@ucalgary.ca
T09 TuTh 2:00PM - 2:50PM Meghji, Safeena  (User of Windows, MAC-OS) safeena.meghji@ucalgary.ca
T10 TuTh 3:00PM - 3:50PM Md, Jaber Al Nahian (Windows user) mdjaberal.nahian@ucalgary.ca
T11 TuTh 4:00PM - 4:50PM Sidratul, Montaha (Windows user) sidratul.montaha@ucalgary.ca
T13 WeFr 2:00PM - 2:50PM Farajpour, Niloufar (User of MAC-OS) niloufar.farajpour@ucalgary.ca
T14 WeFr 3:00PM - 3:50PM Farajpour, Niloufar  (User of MAC-OS) niloufar.farajpour@ucalgary.ca

In addition to the Teaching Assistants who teach sections there are two additional TAs who will staff the remote Zoom Help tutorials (Danissa also staffs a few shifts in the person Help tutorial as well):

Teaching schedule for the teaching tutorials

Shortcuts to each week

Week
 
Activities for the teaching tutorials
Sept. 3 - 9
 
No tutorials this week
Tutorials week 1: Sept. 10 - 16 (tutorials start this week)
  First tutorial:
  • Time to work through D2L/file extension assignment [A0] with the instructor being available for help.
  • Going over the [Premini-A1] requirements

Second tutorial: [Examples] [Exercises]

  • Running the IDLE python editor
  • Display of output
  • Triple quoted output
  • Common operators
  • Operator precedence, the order of execution for python operator

Tutorials week 2: Sept. 17 - 23
  First tutorial [Examples] [Exercises]
  • Code details of documentation and variable naming conventions
  • Coding details of named constants
  • Getting user input
  • Formatting output using escape codes
  • Variables & information types
  • Formatting output using format specifiers

Second tutorial [Examples]

  • Types of programming errors: syntax, runtime, logic
  • Syntax for writing documentation, assignment documentation requirements for your python programs
  • Making backups and program versioning
  • Going over assignment requirements for  [mini-A1]
Tutorials week 3: Sept. 24 - 30 (Saturday September 30 is not a workday)
 

 

  First tutorial
  • Going over assignment requirements for  [A1]

Second tutorial [Examples] [Exercises]

  • IF
  • IF-ELSE
  • Logic (AND, OR, NOT) and branching
Tutorials week 4: Oct. 1 - 7
  First tutorial [Examples]
  • IF-ELIF
  • Multiple IFs
  • Examples of logic errors in branches
  • Going over assignment requirements for [mini-A2a]

Second tutorial [Examples] [Exercises]

  • Introducing WHILE-loops
  • Introducing FOR-loops
  • Iterating (stepping through) strings using a loop.
  • Generating random numbers using the random module (library)
Tutorials week 5: Oct. 8 - 14 (Monday Oct. 10 is a holiday)

 

  First tutorial (Monday: T04, Tuesday: T05 - T11, Wednesday: T13 - T14):
  • No tutorial on Monday due to holiday for T04
  • To synchronize teaching the other tutorials (T05-T14) will be cancelled this week.

Second tutorial [Examples]

  • Going over assignment requirements for [mini-A2b]
  • Bug hunting: Tips for finding and fixing the errors in your programs.
  • TAs will clarify what is and is not allowed in terms of helping others (collaboration) vs. academic misconduct. Presentation material [PDF] [PowerPoint]
Tutorials week 6: Oct. 15 - 21
  First tutorial
  • Going over assignment requirements for [mini-A2c]
  • Going over assignment requirements for [A2]
Second tutorial [Examples] [Exercises]
  • Tracing simple programs employing functional decomposition (defining and calling your own functions)
  • Declaring variables that are local to a function.
  • Scope: global constants vs. local variables.
  • Simple parameter passing examples.
  • Introducing function return values: learning the mechanics of "how to do it"

 

Tutorials week 7: Oct. 22 - 28
 

First tutorial [Examples] [Exercises]

  • More complex examples of programs employing functions: return values, local variables, global variables, scope, tracing the order of function calls, parameter passing mechanisms (value, reference), the importance of programming style (tracing an example employing bad style in order to illustrate)

Second tutorial

  • Going over assignment requirements for [mini-A3a]
  • Going over assignment requirements for [mini-A3b]
Tutorials week 8: Oct. 29 - Nov. 4

 

  Tutorial resources for the week: [Examples] [Exercises]

First tutorial (one of the exercises includes a review of something similar to the midterm questions from this semester).

  • Review exercise: branching, looping, nesting
  • Basics of lists vs. strings.
  • Creating fixed sized lists, creating lists dynamically & randomly.
  • List references and passing lists as parameters.
  • Using the chr function and ASCII codes.

Second tutorial

  • 2D lists:
    • Creating fixed sized lists, creating lists dynamically & randomly.
    • Accessing and modifying list elements.
    • Checking the state of elements in a 2D list.
    • Boolean functions for 2D lists.
Tutorials week 9: Nov. 5 - 11
  First tutorial:
  • Review of pre-midterm topics: Because the proportion of students who appear to have trouble with pre-midterm concepts (as compared to students in other semesters) this tutorial will include a number of review examples and exercises: [Examples] [Exercises]
  • Functional decomposition: some extra examples and exercises that are largely inspired by the problems I saw in student A2 programs: [Examples] [Exercise from lecture that we didn't have time to cover]

Second tutorial:

No tutorials: Nov. 12 - 18 
  Reading week: no teaching or help tutorials scheduled for this week
Tutorials week 10: Nov. 19 - 25
  First tutorial: [Examples] [Exercises]
  • TAs over go over common student issues encountered with full A2.
  • Pass-by-reference: modifying list data during a function call.
  • List operation: Deep copy
  • Determining the relative (row,column) coordinates of other cells in a list for any given location in the list.
  • Implementing a [debug mode] in a program (this is a required feature of Full-A3)
  • Going over assignment requirements for [mini-A3c]

Second tutorial: [Exercises]

  • Going over assignment requirements for [A3]
  • How to determine what functions that may be implemented from an assignment requirements document.
Tutorials week 11: Nov. 26 - Dec. 2
  First tutorial
  • Error handling with files: [Examples]
  • Reading the contents of a file into a variable sized 2D list: [Example]
  • Tuples and strings: [Examples]

Second tutorial:

  • A multi-version example illustrating how programs with logic errors when reading from a file can be debugged. [Examples]
 
Tutorials week  12: Dec. 3 - 9 (Wed. Dec. 7 is the last day of classes)
  All tutorials (Monday, Tuesday, Wednesday): 'open tutorial'.
  • No new teaching will occur.
  • The tutorial instructor will be available during the scheduled tutorial time for the regular teaching tutorial.
  • Similar to regular CT, students can attend the help session of any tutorial instructor and not just the one they are registered in.
  • Here is a link to the [Teaching tutorial schedule] so you can see all the sessions of open tutorial for the week.

Help tutorials = Continuous tutorials (or CT for short) where you can go for help outside of class:

Help/Continuous tutorial (CT) schedules:

Main grid: course schedule for the lecture, lecture notes, assignment information

Shortcuts to each week

Approximate time each topic will be covered in lecture

Lecture topics & schedule

Relevant chapters from the recommended textbook Python for everyone: 3rd edition (Wiley)

Also you can search the UC library website [Link 1] or [Link 2]  for 'free' python eTexts (requires authentication).

Graded component due/occuring during the week: Note that all assignments are due at 4 PM

 
  • How to work from home etc.. A portion will be covered in tutorial later in the term term, other resources are available for your reference: [Orientation link]

 

  • Searching for help using Google (note this is meant to supplement and but not act as a replacement for lecture and tutorial lessons). [PDF notes] [PowerPoint notes]
  • Not applicable
[Link to all practice assignments]
Lecture Week 1: Sept. 3 - 9 (the first lecture for this class is Sept. 6) Administrative information for the course such as contact information, grading etc. [PDF notes] [PowerPoint]
  • Not applicable
 
Lecture Week 2: Sept. 10 - 16 Introduction to programming.
  • Introduction to programming: Section 1.4 - 1.6, Chapter 2, Appendix A, B, C.
 
[A0(submitting files using D2L and checking submissions, not graded but highly recommended, submission closes off on Friday Sept. 15).
Lecture Week 3: Sept. 17 - 23

Introduction to programming.

  • Part III, named constants, documentation, pre-created python functions, common programming errors, programming style (layout and formatting of your program code): [PDF notes] [PowerPoint] [Examples]

Branching.

  • Introduction to programming (as listed above).
  • Branching: Chapter 3

     

[Mini-pre-A1] due Wed. Sept. 20 (TA deadline to have grading complete Sept. 27)

 

Lecture Week 4: Sept. 24 - 30

Branching.

  • Part II: Branching/decisions: logic and branching, multiple IFs, the IF-ELIF structure, nested branches, the  IF-IN operator: [PDF notes] [PowerPoint] [Examples] [Exercises]
Repetition.
  • Branching (as listed above)
  • Repetition: Chapter 4
 
 
Lecture Week 5: Oct. 1 - 7 Repetition.
  • Part III, Looping/repetition, Part 3 (to save lecture time, less challenging non-technical topics like this one will be presented via a pre-created video - link in D2L): Usability heuristics for user friendly program design: [PDF notes] [PowerPoint]
  • Extra resource, nesting and loops (optional): This semester some of this material was incorporated into Part II of the repetition notes and one of the assignment descriptions [PDF notes] [PowerPoint]

 

  • Repetition (as listed above)
 
Lecture Week 6: Oct. 8 - 14 (Monday Oct. 9 is a holiday) Functional decomposition.
  • Part I, the top down approach to functional decomposition, defining & calling new functions that you write, local variables, scope (global vs. local): [PDF notes] [PowerPoint] [Examples]
  • Part II, Parameter passing, function return values, function specific style requirements, documenting functions. [PDF notes] [PowerPoint] [Examples]

 

  • Functions: Chapter 5 (don't worry about the material in Section 5.9, 5.10)
[Mini-A1] due Wed. Oct. 11 (TA deadline to have grading complete Oct. 18)

 

Lecture Week 7: Oct. 15 - 21 Functional decomposition.
  • Part II (Continued)
  • Part III: return to scope, what level/where to declare variables, Boolean functions, splitting up long functions, common errors with functions, program design & testing functions. [PDF notes] [PowerPoint] [Examples]
  • Functions (as listed above)
[Full A1] due Tue. Oct. 17 (TA deadline to have grading sent to instructor: Oct. 24)

[Mini-A2a] due Thur. Oct. 19 (TA deadline to have grading complete Oct. 26)

 

In class (in the lecture room during normal lecture time) midterm: Wed. Oct, 18 [Midterm information]

Lecture Week 8: Oct. 22 - 28 Functional decomposition.
  • Part III (Continued)

Functions/decomposition: Helper exercises/programs:

  • Helper 1:  Determining the level in a functional hierarchy should variables be declared.
  • Helper 2: Decomposing a nested structure into multiple functions.
  • Helper 3: Inter-function communication. Local information from one function needed in another function.

Composites: lists.

 

  • Functions (as listed above)
  • Composites (Lists): Chapter 6

 

[Mini-A2b] due Tue. Oct. 24 (TA deadline to have grading complete Oct. 31)

 

[Mini-A2c] due Wed. Oct. 25 (TA deadline to have grading complete Nov. 1)

 

Lecture Week 9: Oct. 29 - Nov. 4 Composites: lists.
  • Part IIAvoiding list bound exceptions, using multi-dimensional lists, creating 2D lists, accessing a 2D list and its parts, basic list operations [PDF notes] [PowerPoint] [Examples]
  • Composites (Lists - as described above):
[Full A2] due. Fri. Nov. 3 (TA deadline to have grading sent to instructor: Nov. 10)
Lecture Week 10: Nov. 5 - 11

Composites: lists. Part 2 of list exercises: advanced problems with 2D lists

Introduction to problem solving: how to come up with a program when the solution or even a definition of the problem isn't immediately self-evident i.e. you're "banging your head against" the wall trying to figure it out. [PDF notes] [PowerPoint] [Examples]

 

[Mini-A3a] due Fri. Nov. 10 (TA deadline to have grading complete Nov. 17)
 Nov. 12 - 18

Reading week: no teaching or help tutorials scheduled for this week

 

 
Lecture Week 11: Nov. 19 - 25

Files & exceptions.

  • Reading from and writing to text files using python's iterating for-loop as well using the more generic algorithm employing a while-loop. Exception handling to deal with common run-time errors. Creating dynamic 2D lists when the dimensions are unknown ahead of time (such as reading the data from a file): [PDF notes] [PowerPoint] [Examples]
 

Composites, strings & tuples.

  • Part III (last two types of composites) declaring variables that are strings or tuples, accessing the entire composite vs. elements of the composite variable, passing strings and tuples as parameters, mutable vs. immutable types, how functions only return a single piece of data (tuple):  [PDF notes] [PowerPoint] [Examples]
  • Files: Section 7.1 - 7.2, 7.5 - 7.6
  • Composites: Strings

[Mini-A3b] due Fri. Nov. 24 (TA deadline to have grading complete Dec. 1)
Lecture Week 12: Nov. 26 - Dec. 2 Introduction to computer science: an overview of some research areas and higher level courses in Computer Science (Human-Computer Interaction, computer graphics, artificial intelligence, computer vision, software engineering, computer security, games programming. (To save lecture time, less challenging non-technical topics like this one will be presented via a pre-created video - link in D2L): [PDF notes] [PowerPoint]

 

  • None
[Mini-A3c] due Fri. Dec. 1 (TA deadline to have grading complete Dec. 8)
Lecture Week 13: Dec. 3 - 9 (Wed. Dec. 6 is the last day of classes) Optional programming concepts (recursion and a brief introduction into object-oriented programming): [PDF notes] [PowerPoint notes] [Examples: O-O] [Examples: Recursion]

A brief overview of computer history: developments in computers and related technologies from the 1940s onward. (To save lecture time, less challenging non-technical topics like this one will be presented via a pre-created video - link in D2L): [PDF notes] [PowerPoint]

 

  • None
[Full A3] due Wed. Dec. 6 (TA deadline to have grading sent to instructor: Dec. 13)
Final exam period (Dec. 9 - 20) The day of the final exam will to be scheduled by university admin staff and not your course instructor. [See the exam schedule in PeopleSoft when the Office of the Registrar has scheduled it]. [Link final exam information]