| To the faculty page of James Tam | Return to the course web page |
|
Day/Time |
Lectures will
be held live during the scheduled day/time (passcode for both =
hope)
|
|
James Tam |
|
|
Office time: Tuesday and Thursday 4:00 - 4:30 PM via Zoom (different meeting link than for the lecture but the same passcode):
|
|
|
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)] (includes the university approvals for topics such as grading)
|
| 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). |
To use the computers in the first floor Math Sciences lab you will login using your CPSC account. By default the account name and password will be identical to that of your university account. For more information about your CPSC account (such as how to change your password) see the following [Information link]. The labs are accessible 24/7 using your UC ID card If you have access problems then contact [Campus security] to your card can be enabled.
Teaching tutorials (you registered for a section with you signed up for the course): Teaching will be in person in the computer labs - below - starting the week of May 8 - 14). Teaching materials will be available in D2L under 'content' in D2L and under Content->Teaching tutorials
- Tutorials include mandatory information for the course. Time will be spent on the following: TA's teaching new skills, discussion of assignment requirements.
Tutorial
Location Instructor name
Contact information
T01: MW 12:00 - 1:50 PM MS 160 Danissa Sandykbayeva (Windows user) danissa.sandykbay1@ucalgary.ca T02: Registration has been suspended due to low enrolment T03: TR 10:00 - 11:50 AM MS 160 Danissa Sandykbayeva (Windows user) danissa.sandykbay1@ucalgary.ca Teaching schedule for the teaching tutorials (additional links will be added during the semester)
Shortcuts for each week of tutorial
Week
Activities for the teaching tutorials
Tutorial week 1: May 5 - 11 (in person tutorials start Wed./Thur. this week): [locations/days/times] Students: Get your [login information squared away] before tutorial First tutorial:
- No tutorials on Monday/Tuesday
Second tutorial: [Examples] [Exercise descriptions] [Starting files for the exercises] [Exercise solutions]
- Time to work through [A0] with the tutorial instructor available for help.
- Going over the [Mini1a] requirements
- Going over the [Mini1b] requirements
- Running the IDLE python editor
- Display of output
- Triple quoted output
- Common operators
- Operator precedence, the order of execution for python operators
- Code details of documentation and variable naming conventions
- Coding details of named constants
- Getting user input
- Variables & information types
Tutorial week 2: May 12 - 18 First tutorial: [Examples] [Exercise descriptions] [Exercises: starting programs] [Exercises: solutions]
- Documenting your python programs
Making backups and program versioning Going over the [Full A1] requirements IF IF-ELSE Logic (AND, OR, NOT) and branching Second tutorial: [Examples] [Exercise descriptions] [Exercises: starting programs] [Exercises: solutions]
- The following will be covered during the first ~3/4 (hour and half) of the Wed or Thursday tutorial:
- IF-ELIF
- Multiple IFs
- Examples of logic errors in branches
- WHILE-loops
- FOR-loops
- Counting FOR-loops (iterating through a number sequence).
- FOR-loops iterating through the characters in a string
- Nesting: a branch in a loop, a loop inside of a loop
For the last half an hour of the second tutorial (approximate estimate depending upon how long it takes the person to go over the above material). Similar to regular CT, students can attend the help session of any tutorial instructor and not just the one they are registered in.
- No new teaching will occur.
- The tutorial instructor will be available during the [scheduled tutorial time in the usual tutorial room] (not the CT area) to answer student questions.
Tutorial week 3: May 19 - May 25 First tutorial:
- Monday May 20: Victoria Day holiday, no classes today.
- Tuesday: In order to stay in sync with Monday's tutorial no classes will be held today. (There will be lecture on May 21 because there is no Monday lecture to sync with).
Second tutorial: [Examples]
- Going over the [mini-A2a] requirements
- Going over the [mini-A2b] requirements
- Going over the [mini-A2c] requirements
- Going over the [Full A2] requirements
- 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]
Tutorial week 4: May 26 - June 1 (some tutorials will be pre-recorded and posted in D2L). First tutorial (Danissa will be away at a conference so there won't be any in person teaching on Monday May 27 or Tuesday May 28, you can find the video in D2L under "Teaching Tutorials"):
- Function basics:
- Tracing simple programs employing functional decomposition (order of function calls).
- Defining and using a Boolean function.
- [Examples] [Exercise descriptions] [Exercises: starting programs] [Exercises: solutions]
- Intermediate and more complex examples: return values, local variables, global variables, scope, tracing the order of function calls, parameter passing mechanisms (value), the importance of programming style (tracing an example employing bad style in order to illustrate)
- Going over the [mini-A3a] requirements
- Going over the [mini-A3b] requirements
Second tutorial:
- Introduction to composites: One-dimensional lists.
- [Examples] [Exercise descriptions] [Exercises: starting programs] [Exercises: solutions]
- Creating lists
- Iterating through lists
- Adding new elements to lists
- Accessing/modifying list elements
- Going over the [mini-A3c] requirements
Tutorial week 5: June 2 - 8 First tutorial:
- 2D lists
- Creating fixed sized lists, creating lists dynamically & randomly
- List references and passing lists as parameter
- Basics of lists vs. strings.
- Using the chr function and ASCII codes
- [Examples] [Exercise descriptions] [Exercises: starting programs] [Exercises: solutions]
Second tutorial:
Tutorial week 6: June 9 - 15 First tutorial:
- Going over the [mini-A4] requirements
- Going over the [Full A4] requirements
- Splitting a python program into separate modules: procedural implementation, global constants declared within a separate module.
- Implementing a program using the Object-Oriented approach:
- Single file/module and multiple files/modules.
- Defining a class with attributes and methods.
- Creating instances of classes (objects).
- The 'self' reference, accessing methods and attributes inside and outside the class constructor.
- [Examples]
- Exercise 1: [Description] [Solution]
- Exercise 2: [Description] [Starting program] [Solution]
- Compressed Archives: [All examples from the 1st tutorial] [All exercise material from the 1st tutorial]
Second tutorial:
- Object-Orientation: [Link to all O-O examples]
- Recursion: [Link to all examples related to recursion]
- Basic recursion: iterative implementations written recursively. [Example1] [Example2] [Example3: error handling]
- Intermediate recursive example: the Fibonacci number sequence. [Example: iterative] [Example: recursive]
- Advanced recursion employing 'back tracking' (maze traversal): [Example]
- Going over the [mini-A5] requirements
- Introduction to graphics and GUIs (graphical user interfaces) using the python Tktiner module [Examples] [Link to a zip with both examples]
Tutorial week 7: June 16 - 22 (last day of the term is Monday June 17) Open tutorial (Monday June 17 is the only class day for the week): Similar to regular CT, students can attend the help session of any tutorial instructor and not just the one they are registered in.
- No new teaching will occur.
- The tutorial instructor will be available during the [scheduled tutorial time in the usual tutorial room] (not the CT area) to answer student questions.
Help tutorials = Continuous tutorials (or CT for short) where you can go for help outside of class
- These in-person sessions will typically be staffed by the tutorial instructors but they are not mandatory for students and are provided so that you can get help.
- Location: First floor Math Sciences computer lab (near MS151 at a long table).
- The CT is not inside of MS151 (the sign on the wall is out of date)
- You are NOT restricted getting help from the CT session staffed by the person whose tutorial you are registered in (you can go to any TA for help).
- If you have questions then it's best to ask them during the CT unless it's a question that can be answered fairly quickly via email.
Continuous tutorial schedule: [Schedule for spring 2024]
Shortcuts for each week of lecture
- Pre-lecture: student orientation
- Week 1: May 5 - 11
- Week 2: May 12 - 18
- Week 3: May 19 - 25
- Week 4: May 26 - June 1
- Week 5: June 2 - 8
- Week 6: June 9 - 15
- There is no lectures during week 7
Approximate time each topic will be covered in lecture Lecture topics & schedule Relevant textbook chapters: "Python for Everyone (3e)" Wiley Also you can search the UC library website [Link] for 'free' python eTexts (requires authentication).
Graded & ungraded component due during the week: Note that all assignments are due at 4 PM Student orientation
- Getting started as a new CPSC student. Includes information on how to access the CPSC computer network when you are working from home. A portion of these lessons will be covered in tutorial later in the term other resources are available for your reference. [Orientation link]
Not applicable [Link to practice problems] Lecture week 1 (1st lecture is Tuesday May 7): May 5 - 11
- Introduction to the course, administrative about how the course will be run such as grading information. [Notes: PDF notes] [Notes: PowerPoint]
- Introduction to computer programming Part I
- Writing and running a python program, variables, displaying information to the user, common math operators. [Notes: PDF notes] [Notes: PowerPoint] [Examples]
- Introduction to computer programming Part II
- Getting information from the user, simple text formatting. [Notes: PDF notes] [Notes: PowerPoint] [Examples]
- Introduction to computer programming Part III
- Named constants, documenting programs, prewritten python functions, common programming errors, programming style: layout and formatting of your program. [Notes: PDF notes] [Notes: PowerPoint] [Examples]
Introduction to programming: Section 1.4 - 1.6, Chapter 2, Appendix A, B, C. Lecture week 2: May 12 - 18
- Introduction to computer programming Part III (continued from last week)
- Branching Part I
- IF, IF-Else, Logical-AND, Logical-OR, Logical-NOT. [Notes: PDF notes] [Notes: PowerPoint] [Examples]
- Branching Part II
- Logic and branching, multiple IFs, the IF-ELIF structure, nested branches, the IF-IN operator, using an epsilon. [Notes: PDF notes] [Notes: PowerPoint] [Examples] [Branching: Exercise]
- Looping/repetition Part I
- While-loops, for-loops, sentinel controlled loops. [Notes: PDF notes] [Notes: PowerPoint] [Examples]
- Introduction to programming (as listed above).
- Branching: Chapter 3
- Repetition/Loops: Chapter 4
- [Mini A1b] Due Friday May 17 (TA deadline to release grades May 24)
Lecture week 3: May 19 - 25 (Monday May 20 is a holiday: no office hours or CT sessions)
Looping/repetition Part I (Continued from last week)
Looping/repetition Part II
- Nesting branches and loops the break instruction and why it generally shouldn't be used, infinite loops, testing loops. [Notes: PDF notes] [Notes: PowerPoint] [Examples] [Case study: branching, looping, nesting in a simple adventure game] [A few practice traces to try on your own]
- Optional extra resource, nesting and loops. This semester some of this material was incorporated into Part II of the repetition notes: [Notes: PDF notes] [Notes: PowerPoint]
- Functions/decomposition Part I
- Part I: The top down approach to functional decomposition, defining functions, calling functions you have defined, scope (local and global), declaring variables locally, benefits of declaring variables locally. [Notes: PDF notes] [Notes: PowerPoint] [Examples]
- Functions/decomposition Part II
- Parameter passing, function return values, function specific style requirements, documenting function. [Notes: PDF notes] [Notes: PowerPoint] [Examples]
- Repetition/Loops: Chapter 4
- Functions: Chapter 5 (don't worry about the material in Section 5.9, 5.10 yet)
- [Full A1] Due Friday May 24 (TA deadline to release grades May 31)
Lecture week 4: May 26 - June 1
- Functions/decomposition Part II (Continued from last week)
- Functions/decomposition 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. [Notes: PDF notes] [Notes: PowerPoint] [Examples]
- Functions/decomposition: Helper exercises/programs:
- Functions: Chapter 5
- [Mini A2a] Due Tuesday May 28 (TA deadline to release grades June 4)
- In class midterm examination (location ENG 60) Thursday May 30 2:45 - 3:45 [Midterm information link]
- [Mini-A2b]: Friday May 31 (TA deadline to release grades June 5)
- [Mini-A2c]: Friday May 31 (TA deadline to release grades June 5)
Lecture week 5: June 2 - 8
- Composites Part I
- Declaring list variables, accessing a list vs. elements in a list, passing list as parameters, methods of parameter passing, avoiding list bound exceptions. [Notes: PDF notes] [Notes: PowerPoint] [Examples] [Exercises]
- Composites Part II
- Using multi-dimensional lists, creating 2D lists, accessing a 2D list and its parts, basic list operations. [Notes: PDF notes] [Notes: PowerPoint] [Examples]
Composites (Lists): Chapter 6
- [Full A2] Tuesday June 4 (TA deadline to have grading sent to instructor: June 11)
- [Mini A3a] Due Wednesday June 5 (TA deadline to release grades June 12
- [Mini A3b] Due Friday June 7 (TA deadline to release grades June 12)
Lecture week 6: June 9 - 15 (last lecture is Thursday)
- Composites Part II (continued from last week)
- [Intermediate exercise: two parallel lists]
- [More advanced exercise: accessing the neighbouring elements of a particular list element]
- Introduction to problem solving (if there is time)
- How to come up with a program when the solution or even a definition of the problem isn't immediately self-evident. [Notes: PDF notes] [Notes: PowerPoint] [Examples]
- 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). [Notes: PDF notes] [Notes: PowerPoint] [Examples]
- Object-Oriented programming): [Notes: PDF notes] [Notes: PowerPoint] [Examples]
- Recursion: [Notes: PDF notes] [Notes: PowerPoint] [Examples]
- Composites 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): [Notes: PDF notes] [Notes: PowerPoint] [Examples]
Lists (as above)
Problem solving: Not applicable
Files: Section 7.1 - 7.2, 7.5 - 7.6
Lecture week 7: June 16 - 22 (17th is the last day of the term).
- No lecture this week as the last day of the term is Monday June 17
Not applicable
Final exam period: June 19 - 22 Final exam information: it will be scheduled by the Office of the Registrar ([Final exam from the office of the Registrar]). [Final exam information]