Syllabus

Week 1: The Introduction

  1. What is a program?
  2. The Python programming language
  3. Installing Python
  4. The first program
  5. Commenting
  6. Debugging
  7. Getting help from the internet
  8. Homework: Due before next class

Important Links: Lecture Note, Example Codes

Week 2: Variables, Expressions and Statements

  1. Assignment statements
  2. Variables
  3. Variable names and keywords
  4. Operators and operands
  5. Expressions and statements
  6. Exercises
  7. Homework: Due before next class

Important Links: Lecture Note, Example Codes

Week 3: Functions

  1. Why functions?
  2. Function calls
  3. Math functions
  4. Adding new functions
  5. Parameters and arguments
  6. Variables and parameters are local
  7. Homework: Due before next class

Important Links: Lecture Note, Example Codes

Week 4: Conditionals and Recursion

  1. Floor division and modulus
  2. Boolean expressions
  3. Logical operators
  4. Conditional execution
  5. Alternative execution
  6. Chained conditionals
  7. Nested conditionals
  8. Recursion
  9. Keyboard input

Important Links: Lecture Note, Example Codes

Week 5: Fruitful Functions and Iterations

  1. Return values
  2. Incremental development
  3. Composition
  4. Boolean functions
  5. Checking types
  6. Reassignment
  7. Updating variables
  8. The while statement
  9. The break statement
  10. The for loop

Important Links: Lecture Note, Example Codes

Week 6: Strings

  1. A string is a sequence
  2. len
  3. String slices
  4. Strings are immutable
  5. Searching
  6. Looping and counting
  7. String methods
  8. The in operator
  9. String comparison

Important Links: Lecture Note, Example Codes

Week 7: Lists, Dictionaries and Tuples

  1. A list is a sequence
  2. Lists are mutable
  3. List operations, Slices, Methods
  4. Deleting elements
  5. Lists and strings
  6. Dictionary as a collection of counters
  7. Looping and dictionaries
  8. Tuples are immutable
  9. Tuples as return values
  10. Lists and tuples
  11. Dictionaries and tuples

Important Links: Lecture Note, Example Codes

Week 8: Files

  1. Persistence
  2. Reading and writing
  3. Format operator
  4. Filenames and paths
  5. Catching exceptions
  6. Databases
  7. Pickling
  8. Pipes
  9. Writing modules
  10. Homework: Due before next class

Important Links: Lecture Note, Example Codes

Final Project Due in 1 week