Week 1: The Introduction
- What is a program?
- The Python programming language
- Installing Python
- The first program
- Commenting
- Debugging
- Getting help from the internet
- Homework: Due before next class
Important Links: Lecture Note, Example Codes
Week 2: Variables, Expressions and Statements
- Assignment statements
- Variables
- Variable names and keywords
- Operators and operands
- Expressions and statements
- Exercises
- Homework: Due before next class
Important Links: Lecture Note, Example Codes
Week 3: Functions
- Why functions?
- Function calls
- Math functions
- Adding new functions
- Parameters and arguments
- Variables and parameters are local
- Homework: Due before next class
Important Links: Lecture Note, Example Codes
Week 4: Conditionals and Recursion
- Floor division and modulus
- Boolean expressions
- Logical operators
- Conditional execution
- Alternative execution
- Chained conditionals
- Nested conditionals
- Recursion
- Keyboard input
Important Links: Lecture Note, Example Codes
Week 5: Fruitful Functions and Iterations
- Return values
- Incremental development
- Composition
- Boolean functions
- Checking types
- Reassignment
- Updating variables
- The while statement
- The break statement
- The for loop
Important Links: Lecture Note, Example Codes
Week 6: Strings
- A string is a sequence
- len
- String slices
- Strings are immutable
- Searching
- Looping and counting
- String methods
- The in operator
- String comparison
Important Links: Lecture Note, Example Codes
Week 7: Lists, Dictionaries and Tuples
- A list is a sequence
- Lists are mutable
- List operations, Slices, Methods
- Deleting elements
- Lists and strings
- Dictionary as a collection of counters
- Looping and dictionaries
- Tuples are immutable
- Tuples as return values
- Lists and tuples
- Dictionaries and tuples
Important Links: Lecture Note, Example Codes
Week 8: Files
- Persistence
- Reading and writing
- Format operator
- Filenames and paths
- Catching exceptions
- Databases
- Pickling
- Pipes
- Writing modules
- Homework: Due before next class
Important Links: Lecture Note, Example Codes
Final Project Due in 1 week