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

CPSC 217: Course outline fall 2022

Index (shortcut to major sections of the webpage)

 

Technical requirements for students in the distance learning version of this course (paraphrased version from what was provided by the university).

 

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)

For those students who are on campus and need quiet space to attend lecture virtually we have the following reserved for each lecture:

  • Fall - CPSC 217 - 10am lecture MWF - SA 119 (50 seats)
  • Fall - CPSC 217 - 1pm lectures MWF - ST 129 (51 seats)

 

Instructor contact Information

James Tam

Office time (not lecture time, not the lecture link): MW (11:00 - 11:50 AM) via a Zoom link (passcode = 'hope'):

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

 

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

T01 (a Windows user): TuTh 1:00PM - 1:50PM Lotfi, Elaheh elaheh.lotfi@ucalgary.ca
T02 (a Windows user): MoWe 2:00PM - 2:50PM Nair, Namita namita.nair@ucalgary.ca
T03 (a Windows user): TuTh 12:00PM - 12:50PM Lotfi, Elaheh elaheh.lotfi@ucalgary.ca
T04 (a MAC user): TuTh 11:00AM - 11:50AM Erfanmanesh, Zeinab zeinab.erfanmanesh@ucalgary.ca
T05 (a MAC user): MoWe 2:00PM - 2:50PM Farajian, Samin samin.farajian@ucalgary.ca
T06 (a MAC user): TuTh 10:00AM - 10:50AM Li, Qiaowang qiaowang.li@ucalgary.ca
T07 (now a MAC user): TuTh 3:00PM - 3:50PM Heidarirad, Hadi hadi.heidarirad@ucalgary.ca 
T08 (a Windows user): MoWe 11:00AM - 11:50AM Ghosh, Reet Rahul reet.ghosh@ucalgary.ca
T09 (a MAC user): MoWe 11:00AM - 11:50AM Farajian, Samin samin.farajian@ucalgary.ca
T10 (a Windows user): TuTh 4:00 PM - 4:50 PM Ghosh, Reet Rahul reet.ghosh@ucalgary.ca
T11 (a MAC user): TuTh 9:00 AM - 9:50 AM Li, Qiaowang qiaowang.li@ucalgary.ca
T12 (now a MAC user): TuTh 4:00PM - 4:50PM Heidarirad, Hadi hadi.heidarirad@ucalgary.ca 
T13 (a Windows user): MoWe 6:00PM - 6:50PM Kamran, Khizer khizer.kamran1@ucalgary.ca
T14 (a MAC user): TuTh 1:00PM - 1:50PM Erfanmanesh, Zeinab zeinab.erfanmanesh@ucalgary.ca
T15 (a Windows user): MoWe 4:00PM - 4:50PM Ravi, Rahul rahul.ravi@ucalgary.ca

In addition to the Teaching Assistants who teach sections there are two additional TAs who will staff the in person Help tutorials (but not the remote Zoom tutorials) (listed in alphabetical order)

What do to if the teaching or help tutorial Zoom link doesn't appear to be running.

Teaching schedule for the teaching tutorials

Shortcuts to each week

Week
 
Activities for the teaching tutorials
Sept. 4 - 10
 
No tutorials this week
Tutorials week 1: Sept. 11 - 17 (tutorials start this week)
 
  • It would handy if you downloaded and installe python [Link to python.org] before this tutorial so you can more easily create a .py file when you go through A0 in class.
  • First tutorial:
    • Time to work through [A0] with the tutorial instructor available for help.
    • Going over the [Pre-mini-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 operators

 

Tutorials week 2: Sept. 18 - 24
  First tutorial: [Examples] [Exercises]
  • Review:
    • Style requirement: naming conventions
    • Style requirement: named constants
  • Getting user input
  • Formatting output using escape codes
  • Information types
  • Formatting output using format specifiers

Second tutorial: [Examples]

  • Types of programming errors: syntax, runtime, logic
  • Documenting your python programs
  • Making backups and program versioning
  • Going over the [mini-A1] requirements
Tutorials week 3: Sept. 25 - Oct. 1 (Friday Sept. 30 there will be no university classes or services)
 

 

  First tutorial:
  • Going over the A1 requirements

Second tutorial: [Examples] [Exercises]

  • IF
  • IF-ELSE
  • Logic (AND, OR, NOT) and branching
Tutorials week 4: Oct. 2 - 8
  First tutorial: [Examples] [Exercises]
  • IF-ELIF
  • Multiple IFs
  • Examples of logic errors in branches
  •  

Second tutorial: [Examples] [Exercises]

  • Going over the [mini-A2a] requirements
  • 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. 9 - 15 (Monday Oct. 11 is a holiday)

 

  First tutorial (Monday or Tuesday):
  • Monday: no tutorials because of the Thanksgiving holiday
  • Tuesday: 'open tutorial'.
    • No new teaching will occur.
    • The tutorial instructor will be available during the scheduled tutorial time via their Zoom tutorial link (not the CT link) to answer student questions.
    • Similar to regular CT, students can attend the help session of any tutorial instructor and not just the one they are registered in.

Second tutorial (Wednesday or Thursday): [Examples] [Exercises]

  • Nesting
    • A branch in a loop
    • A loop inside of a loop
  • Bug hunting: Tips for finding and fixing the errors in your programs.
Tutorials week 6: Oct. 16 - 22
  First tutorial (Monday or Tuesday): [Examples] [Exercises]
  • Going over the mini-A2b requirements
  • 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"

Second tutorial (Wednesday or Thursday): [Examples] [Exercises]

  • Passing parameters by value.
  • Returning to program scope and learning about the need for function return values.
  • Determining the order of function calls.
  • Defining and using a Boolean function.
  • Tracing more complex programs which employ functional decomposition.
  • Illustrating the importance of good programming style (by employing poor style).
Tutorials week 7: Oct. 23 - 29
  First tutorial (Monday or Tuesday): [Exercises]
  • Going over the A2 requirements

Second tutorial (Wednesday or Thursday):

  • TAs over go over common student issues encountered with full A1.
  • TAs go over in detail in terms is and is not allowed in terms of helping others (collaboration) vs. academic misconduct. Presentation material [PDF] [PowerPoint]
  • Going over the Mini-A3a requirements
  • Going over the Mini-A3b requirements

 

Tutorials week 8: Oct. 30 - Nov. 5

 

  First tutorial (Monday or Tuesday): [Examples]
  • Return to student points of confusion.
    • Using branches vs. loops.
    • Understanding for-loops by examining the equivalent while-loop.
  • Reminder: python for-loops can iterate through more than just numerical sequences e.g. the characters in a string.

Second tutorial (Wednesday or Thursday): [Examples] [Exercises]

  • Basics of lists vs. strings.
  • Creating fixed sized lists, creating lists dynamically & randomly.
  • List references and passing lists as parameters.
No tutorials: Nov. 6 - 12
  Reading week: no teaching or help tutorials scheduled for this week
Tutorials week 9: Nov. 13 - 19
  First tutorial (Monday or Tuesday): [Examples]
  • 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.

Second tutorial (Wednesday or Thursday): [Examples] [Exercises]. These exercises are larger and more complex in order to help you for Full A3 so you may want to read through the description and even try implementing a solution before the tutorial).

  • Passing lists as parameters.
  • Implementing more complex problems using 2D lists (text-based board game).
  • More examples of Boolean functions for 2D lists.
  • Implementing a debug mode in a program (this is a required feature of Full-A3).
 
Tutorials week 10: Nov. 20 - 26
  First tutorial (Monday or Tuesday):
  • Going over the Mini-A3c requirements
  • Going over the A3 requirements

Second tutorial (Wednesday or Thursday): [Examples] [Exercises].

  • TAs over go over common student issues encountered with full A2.
  • How to determine what functions that may be implemented from an assignment requirements document.
  • File input:
    • Getting a program to repeatedly prompt for file information if there are any I/O exceptions.
    • Checking for blank file names.
    • Checking for empty files.
    • Echoing the contents of a file onscreen.
Tutorials week 11: Nov. 27 - Dec. 3

 

 

First tutorial (Monday or Tuesday):

  • Error handling with files: [Example]
  • Reading the contents of a file into a variable sized 2D list: [Example]
  • Tuples and strings: [Examples]

Second tutorial (Wednesday or Thursday):

  • A multi-version example illustrating how programs with logic errors when reading from a file can be debugged. [Example]
 
Tutorials week  12: Dec. 4 - 10 (Wed. Dec. 8 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 via their Zoom tutorial link (not the CT link) to answer student questions.
    • Similar to regular CT, students can attend the help session of any tutorial instructor and not just the one they are registered in.

 

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. 4 - 10 (the first lecture for this class is Sept. 7) Administrative information for the course such as contact information, grading etc. [PDF notes] [PowerPoint]
  • Not applicable
 
Lecture Week 2: Sept. 11 - 17 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. 16).
Lecture Week 3: Sept. 18 - 24

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 notes] [Examples]

Branching.

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

     

Mini-pre-A1 due Wed. Sept. 21 (TA deadline to have grading complete Sept. 28)

 

Lecture Week 4: Sept. 25 - Oct. 1 (Friday Sept. 30 there will be no university classes or services)

Branching.

Repetition.
  • Branching (as listed above)
  • Repetition: Chapter 4
 
 
Lecture Week 5: Oct. 2 - 8 Repetition.
  • Part III, Looping/repetition, Part 3: Usability heuristics for user friendly program design: [PDF notes] [PowerPoint]
  • Extra resource, nesting and loops: 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. 9 - 15 (Monday Oct. 10 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 notes] [Examples]
  • Part II, Parameter passing, function return values, function specific style requirements, documenting functions. [PDF notes] [PowerPoint notes] [Examples]

 

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

 

Lecture Week 7: Oct. 16 - 22 (no lecture on Friday, instead extra office hours via the [Office hour link] will be held if you have questions during the exam). 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 notes] [Examples]
  • Functions (as listed above)
Full A1 due Tue. Oct. 18 (TA deadline to have grading sent to instructor: Oct. 25)

Mini-A2a due Thur. Oct. 20(TA deadline to have grading complete Oct. 27)

 

[Midterm information:] available during a 24 hour window On Fri. Oct 21 (max. 120 minutes)

Lecture Week 8: Oct. 23 - 29 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. 25 (TA deadline to have grading complete Oct. 1)

 

Lecture Week 9: Oct. 30 - Nov. 5 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 notes] [Examples]
  • Composites (Lists - as described above):
Full A2 due. Fri. Nov. 4 (TA deadline to have grading sent to instructor: Nov. 11)
Nov. 6 - 12 Reading week: no teaching or help tutorials scheduled for this week    
Lecture Week 10: Nov. 13 - 19

Composites: lists. Part 2 of list exercises: advanced problems with 2D lists [Exercise 1: parallel lists, state of one list affecting the other list] [Exercise 2: abstract painting program by Tam, list events affecting neighbouring elements]

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. [PDF notes] [PowerPoint notes] [Examples]

 

  • Files: Section 7.1 - 7.2, 7.5 - 7.6

Mini-A3a due Fri. Nov. 18 (TA deadline to have grading complete Nov. 25)
Lecture Week 11: Nov. 20 - 26

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 notes] [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 notes] [Examples]
  • Composites: Strings

Mini-A3b due Fri. Nov. 25 (TA deadline to have grading complete Dec. 2)
Lecture Week 12: Nov. 27 - Dec. 3 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. [PDF notes] [PowerPoint notes]
  • None
Mini-A3c due Fri. Dec. 2 (TA deadline to have grading complete Dec. 9)
Lecture Week 13: Dec. 4 - 10 (Wed. Dec. 7 is the last day of classes) Optional programming concepts (recursion and a brief introduction into object-oriented programming): [PDF notes] [PowerPoint notes]

A brief overview of computer history: developments in computers and related technologies from the 1940s onward. [PDF notes] [PowerPoint notes]

  • None
Full A3 due Wed. Dec. 7 (TA deadline to have grading sent to instructor: Dec. 14)
Final exam period The day of the final exam will to be scheduled by university admin staff and not your course instructor. Similar to the midterm you will have 24 hour during which you can write your exam. [See the exam schedule in PeopleSoft when the Office of the Registrar has scheduled it]. With the exam rules I received the length of the exam must be 120 minutes because (according to the USC) asynchronous exams must be designed so it can be completed within the duration,  specified in PeopleSoft. You can write your exam during a 24 window starting 12:01 AM Dec. 19, ending 11:59 PM Dec. 19. [Link to information about the final exam]