COMP110 Course Curriculum


Comp110 Curriculum

Here is the basic breakdown of concepts covered in this class. We know Unit 0 seems long and daunting, and that’s because this class can have a steep learning curve! But these concepts are more straightforward and less complicated than those in the later units, and we will spend ample time on them!

Unit 0 - The basics

  • The basics of VS Code and running a Python program
  • Objects and Data Types
    • Basic types (int, float, str, bool)
  • Commenting and Doc Strings
  • Expressions
    • Evaluating Expressions
    • Order of Operations
    • What type expressions evaluate to
  • Variables and User Input
    • Syntax for initializing a variable and assigning it a value
    • Syntax for updating a variable’s value
    • Using the input() function to prompt for and receive user input

Unit 1 - Conditionals, Booleans, and Memory Diagrams

  • A. Conditionals
    • Syntax of an if block
    • Syntax of an if…else block
  • B. Booleans
    • Evaluating Boolean Expressions
    • How not, and, or work
    • Order of Operations
    • Using boolean expressions in a conditional
  • C. Memory Diagrams
    • Establishing a stack and an output box
    • Diagramming basic variable assignments and updates
    • Diagramming Conditionals

Unit 2 - While loops + some useful tools

  • A. While Loops
    • Syntax of a while loop
    • Idea of indexing
    • While loops in memory diagrams
  • B. Counters
    • How to create and use a variable as a counter
  • C. Relative Reassignment Operators
    • Functionality of relative reassignment operators
  • D. Unicode, Emoji, Escape Sequences, and f-Strings
    • String Escape sequences
    • F-strings: how to write them in code and evaluate them when printed

Unit 3 - Functions

  • A. Functions
    • Calling functions
    • Importing functions
    • Returning vs Printing
  • B. Function Syntax
    • Syntax for defining a function
    • Syntax for calling a function
    • The similarities and differences of signatures and function calls (including parameters vs. arguments)
    • Calling functions within functions
  • C. Function Semantics
    • Memory Diagram representation of function definitions and calls
      • Function frames
      • Function call steps
      • Heap storage
      • Return Address and Values
  • D. Scope
    • Applying scope to memory diagrams in terms of function call frames
    • Understanding global and local variables
  • E. Importing Modules
    • Knowing basic import syntax: from <package-name> import <module-name> and from <package-name>.<module-name> import <function>
    • Knowing usage of if __name__ == "__main__":

Unit 4: ‘for’ loops, Lists, Dictionaries, and Unit Tests

  • A. Lists
    • Basic list syntax and typing
    • Indexing on lists and updating values at an index (subscription notation)
    • len() function
    • methods: .append() and .pop()
  • B. Lists in Memory
    • Memory Diagrams with lists
    • Writing functions with lists (both modifying existing lists or creating new lists)
  • C. for loops
    • Using for ... in ... syntax in memory diagrams and writing functions
    • Using for ... in range(...) syntax in memory diagrams and writing functions
  • D. Dictionaries
    • Basic list syntax and typing
    • Accessing, adding, and modifying values at an index (subscription notation)
    • function: len()
    • method: .pop()
    • using the boolean expression: elem in dictionary
    • Memory Diagrams with dictionaries
    • Using a for loop to iterate through a dictionary’s keys
  • E. Unit Tests

Unit 5 - Algorithms and Runtime Analysis

Unit 6 - Recursion

Unit 7 - Object Oriented Programming

  • Syntax for defining a Class and its methods
    • Creating a Class
    • Listing attributes and their types
    • Defining a constructor method (__init__)
    • Defining a method within the class
  • Syntax for instantiating a Class and calling methods
    • Importing a Class and calling its constructor
    • Calling methods on an object of a defined Class
    • Accessing attributes of an object of a Class (e.g. my_pizza.toppings)
  • Classes in Memory
    • Memory diagram for a Class definition and instantiation (Hint: Try making a step-by-step procedure as outlined here.)

Unit 8 - Advanced Object Oriented Programming

  • Magic Methods
    • Syntax for defining and calling a magic method
    • Writing a __str__ magic method
    • Diagramming a __str__ magic method
  • Operator Overloads
    • Syntax for defining and calling a magic method that overloads operators
    • Writing and Diagramming both __add__ and __mul__ magic methods
Contributor(s): Alyssa Byrnes