Lecture 1 - Outline
Learning Objectives
- Running a python file and printing
- Variables
- Functions
- Types
- Integer Divison and Modulus
- Basic if-else statements
Lecture Plan
- Who am I and why are you here?
Logistics
- Syllabus -- there will be a quiz!
- Website
- Autolab
- Piazza
- Office Hours
- Recitation
- Small Group Sessions
- Large Group Sessions
- First one is on Wednesday 12 - 2 pm
- Fourth of July OH
Running a python file using Pyzo
- Print function (console output)
- Comments
Types
- int, float, str, bool
- Type vs. isinstance
- math module
Built-in operators
Integer Division
Modulus
- Don't worry about mod with negatives
Break -- attendance check
Functions + Function Vocabulary
Print versus Return
- No return -> returns None
almostEqual and Floats
Global + Local Variable Scope
Basic Conditionals
- If statement
- If-else statement
Moved Topics
- Errors
- Type affects semantics
- Short circuit evaluation
- Default Arguments
- Input
- Negative Mod
- Helper Functions
- Function Composition
HW1
Tests: types, functions, if-else conditionals, logical operators, div-mod, floats + almostEquals
- distance
- isEquilateralTriangle
- getKthDigit
- isPerfectSquare
Up Next
- more conditionals
- helper functions
- loops