Course materials

CSC 111

Introduction to Programming

Fall 2023 · Spring 2024 · Spring 2025

01 · Syllabus

Course information and policies

InstructorQixin Deng

Email[email protected]

OfficeGoodrich Hall 108

Office hoursM/W/F afternoons before 5:00 PM, or by appointment

Meeting timeT/Th 9:45–11:00 AM

LocationHays Science 003 Lecture

Course Description

We use Python to learn computer programming, beginning with syntax, variables, built-in data structures, control flow, and functions. After developing confidence with procedural programs, the course introduces object-oriented programming, including classes, objects, inheritance, and methods.

Reference Notes & Platforms

Students are encouraged to learn from the official Python tutorial and documentation and to consult Stack Overflow responsibly. Supported environments include PyCharm, Google Colab, and Jupyter Notebook.

Course Goals

  • Learn basic Python syntax, grammar, and data structures.
  • Use control flow and functions to solve computational problems.
  • Understand and program with object-oriented principles.

Assignments

Weekly assignments require both working code and a clear explanation of the solution process, including ideas, errors, debugging decisions, and corrections. Code and the accompanying report must be submitted by the deadline; late submissions are not accepted.

Grading

Assignments constitute 50% of the course grade and exams constitute 50%. Standard letter-grade thresholds are used, beginning with A at 93, A− at 90, B+ at 87, and continuing through the published scale.

Class Rules

The classroom must remain respectful and free of discrimination, bullying, and other harmful conduct. Violations are addressed through course and college procedures.

Important Dates

Midterm and final exam dates are announced during the semester and communicated through the course platform.

About AI

AI can be a useful assistant when used reasonably, but it must not replace a student’s thinking. Assignments must be completed independently. Students should understand and be able to reproduce and explain all submitted work; significant inconsistencies may require an in-person demonstration and may be reported under academic-integrity procedures.

02 · Contents

Course content

01

Python Foundations

Identifiers, naming conventions, syntax, comments, indentation, operators, numeric representations, namespaces, formatted input, and output.

02

Built-in Data Structures

Numbers, strings, lists, tuples, sets, and dictionaries, including mutability, references, shallow and deep copying, and common operations.

03

Program Control & Functions

Conditional reasoning, loops, comprehensions, iterators, generators, function parameters, return values, scope, recursion, lambdas, and higher-order functions.

04

Files, Errors & Program Organization

Reading and writing files, paths, CSV data, exceptions, assertions, modules, and organizing reliable programs.

05

Object-Oriented Programming

Classes, objects, abstraction, encapsulation, inheritance, polymorphism, special methods, and reusable object-oriented design.

06

Decorators

Functions as objects, inner functions, closures, function and class decorators, arguments, preserved identity, state, timing, debugging, and caching patterns.

07

Dependency Management

Python packages, __init__.py, imports, pip commands, requirements files, versioned dependencies, and reproducible environments.

08

Logging Files

Log levels, formatting, file handlers, custom loggers, filters, CSV handlers, and using logs to observe and debug running programs.

03 · Exam preparation

Shared exam expectations

Gentleman’s Rule

The student is expected to conduct himself, at all times, both on and off the campus, as a gentleman and a responsible citizen.

Exam Rules

  • This is a closed-book exam with only a pen (no pencil) and exam paper on your desk. No calculators allowed. No outside aids or resources are allowed.
  • Final exam will be 2 hours, other exams will be using regular class time. Please arrive on time. Late students will not be compensated for their time.
  • You are responsible for the clarity of your own handwriting. If I cannot recognize your handwriting, you will lose points.
  • All cell phones and other electronic devices must be turned off.
  • If you need to use the bathroom during the exam, you need to put your cell phone on the front desk.
  • You are not allowed to communicate with any other people (other than the professor) while taking this exam.
  • You may not share, disseminate, or discuss these questions with any other student in another section of this course who has not taken the exam yet; doing so is considered academic dishonesty and will lead to nullification of exam grades.
  • There will be no tolerance towards academic dishonesty, and cheating can and will lead to automatic failure from the class as well as a report to the Academic Integrity Committee.

Exam Commitments

I will complete this exam in a fair, honest, respectful, responsible, and trustworthy manner. This means that I will complete the exam as if the professor was watching my every action. I will act according to the professor’s instructions, and I will neither give nor receive any aid or assistance other than what is authorized. I know that the integrity of this exam and this class is up to me, and I pledge not to take any action that would break the trust of my classmates or professor, or undermine the fairness of this class.

Exam 1 PreparationDate: To be announcedLocation: To be announced+

Review Instruction

There are only short answer questions: (1) Read and explain the output of a given piece of code. (2) Write simple statements to complete a short Python program.

  • There will be a total of 8 questions, and each question has 2 to 7 sub-questions. I will reuse some questions in your midterm paper, so make sure you understand every question on the midterm paper.
  • Q1 is about Python basics. You should be familiar with valid identifiers, binary and hexadecimal number conversions, logical operators such as not, and, and or, as well as basic arithmetic and bitwise operators, with particular emphasis on the left and right shift operators.
  • Q2 is about Python data structures. You should be familiar with basic slicing and indexing operations, as well as the operators (* and +) for strings and lists. Additionally, it’s important to know functions like replace() and split() for strings, and update() for dictionaries. Also, make sure to understand the copying behavior in Python.
  • Q3 is about Python functions. You should be familiar with how to properly define positional-only parameters, keyword-only parameters, and how to use variable-length parameters in a function signature. Additionally, you should be able to write basic lambda expressions and recursive functions, as outlined in the relevant questions of your assignment. Furthermore, you need to understand several higher-order functions we covered in class (map(), filter(), reduce()) and be able to write the result of a short program that utilizes these functions.
  • Q4 is about conditional statements. You should understand logical and comparison operators and be able to determine the output of a short program that uses if statements and the ternary operator.
  • Q5 is about for loops. You should be able to explain the difference between a for loop and a while loop, understand the range() and enumerate() functions, and determine the output of short programs using for loops or nested for loops. You should also understand the for...else structure and, additionally, be able to read and write list comprehensions.
  • Q6 is about while loops. You should be able to determine the output of short programs that use while loops, understand the structure of while...else..., and grasp how the continue and break statements behave.
  • Q7 is about file and exception handling. Understand the open() function and the with statement; learn the structure of try-except-else-finally; and practice writing the output of short programs that use the try-except-else-finally structure.
  • Q8 is about OOP. You need to understand the difference between the init and new methods, grasp the concept of MRO (Method Resolution Order), and know how the super() function works. Additionally, you must be able to write both the init and new methods, as there will be a question requiring you to complete these two functions.
Exam 2 PreparationDate: To be announcedLocation: To be announced+

Review Instruction

There are only short answer questions: (1) Read and explain the output of a given piece of code. (2) Write simple statements to complete a short Python program.

  • There will be a total of 8 questions, and each question has 2 to 7 sub-questions. I will reuse some questions in your midterm paper, so make sure you understand every question on the midterm paper.
  • Q1 is about Python basics. You should be familiar with valid identifiers, binary and hexadecimal number conversions, logical operators such as not, and, and or, as well as basic arithmetic and bitwise operators, with particular emphasis on the left and right shift operators.
  • Q2 is about Python data structures. You should be familiar with basic slicing and indexing operations, as well as the operators (* and +) for strings and lists. Additionally, it’s important to know functions like replace() and split() for strings, and update() for dictionaries. Also, make sure to understand the copying behavior in Python.
  • Q3 is about Python functions. You should be familiar with how to properly define positional-only parameters, keyword-only parameters, and how to use variable-length parameters in a function signature. Additionally, you should be able to write basic lambda expressions and recursive functions, as outlined in the relevant questions of your assignment. Furthermore, you need to understand several higher-order functions we covered in class (map(), filter(), reduce()) and be able to write the result of a short program that utilizes these functions.
  • Q4 is about conditional statements. You should understand logical and comparison operators and be able to determine the output of a short program that uses if statements and the ternary operator.
  • Q5 is about for loops. You should be able to explain the difference between a for loop and a while loop, understand the range() and enumerate() functions, and determine the output of short programs using for loops or nested for loops. You should also understand the for...else structure and, additionally, be able to read and write list comprehensions.
  • Q6 is about while loops. You should be able to determine the output of short programs that use while loops, understand the structure of while...else..., and grasp how the continue and break statements behave.
  • Q7 is about file and exception handling. Understand the open() function and the with statement; learn the structure of try-except-else-finally; and practice writing the output of short programs that use the try-except-else-finally structure.
  • Q8 is about OOP. You need to understand the difference between the init and new methods, grasp the concept of MRO (Method Resolution Order), and know how the super() function works. Additionally, you must be able to write both the init and new methods, as there will be a question requiring you to complete these two functions.
Final Exam PreparationDate: To be announcedLocation: To be announced+

Review Instruction

There are only short answer questions: (1) Read and explain the output of a given piece of code. (2) Write simple statements to complete a short Python program.

  • There will be a total of 8 questions, and each question has 2 to 7 sub-questions. I will reuse some questions in your midterm paper, so make sure you understand every question on the midterm paper.
  • Q1 is about Python basics. You should be familiar with valid identifiers, binary and hexadecimal number conversions, logical operators such as not, and, and or, as well as basic arithmetic and bitwise operators, with particular emphasis on the left and right shift operators.
  • Q2 is about Python data structures. You should be familiar with basic slicing and indexing operations, as well as the operators (* and +) for strings and lists. Additionally, it’s important to know functions like replace() and split() for strings, and update() for dictionaries. Also, make sure to understand the copying behavior in Python.
  • Q3 is about Python functions. You should be familiar with how to properly define positional-only parameters, keyword-only parameters, and how to use variable-length parameters in a function signature. Additionally, you should be able to write basic lambda expressions and recursive functions, as outlined in the relevant questions of your assignment. Furthermore, you need to understand several higher-order functions we covered in class (map(), filter(), reduce()) and be able to write the result of a short program that utilizes these functions.
  • Q4 is about conditional statements. You should understand logical and comparison operators and be able to determine the output of a short program that uses if statements and the ternary operator.
  • Q5 is about for loops. You should be able to explain the difference between a for loop and a while loop, understand the range() and enumerate() functions, and determine the output of short programs using for loops or nested for loops. You should also understand the for...else structure and, additionally, be able to read and write list comprehensions.
  • Q6 is about while loops. You should be able to determine the output of short programs that use while loops, understand the structure of while...else..., and grasp how the continue and break statements behave.
  • Q7 is about file and exception handling. Understand the open() function and the with statement; learn the structure of try-except-else-finally; and practice writing the output of short programs that use the try-except-else-finally structure.
  • Q8 is about OOP. You need to understand the difference between the init and new methods, grasp the concept of MRO (Method Resolution Order), and know how the super() function works. Additionally, you must be able to write both the init and new methods, as there will be a question requiring you to complete these two functions.

04 · Assignments

Practice questions

Open each assignment to work directly from the original questions. Students should record their reasoning, errors, revisions, and final solution without using AI to solve the work.

Assignment 01+

Loading questions…

Assignment 02+

Loading questions…

Assignment 03+

Loading questions…

Assignment 04+

Loading questions…

Assignment 05+

Loading questions…

Assignment 06+

Loading questions…

Assignment 07+

Loading questions…

Assignment 08+

Loading questions…

Assignment 09+

Loading questions…

Assignment 10+

Loading questions…

05 · Projects

Project questions and requirements

Open each project to view the original prompt and complete requirements.

Project 01 — Restaurant Simulation+

Loading questions…

Project 02 — Student Management System+

Loading questions…