Module 2: Control Structures

Making choices and repeating things

Language Topics

  • Conditional statements (if/elif/else)
  • Relational operators (==,!=,<,>,etc)
  • Logical operators (and,or,not) and complex conditions
  • while loops, break and continue

Textbook chapters 4 and 5

Assignment: Tic Tac Toe

Due Tuesday, 10/11

Tue, Sep 20

Module 1 Recap

Preparation and Exam

Nested Loops Exercise

  • Textbook 5.8

Assignments

  • Bring Nested Loops Exercise to class Thu
  • Mentoring meetings
  • Catch up: fundamentals practice:
    • Spend time coding!
    • Textbook Challenge Exercises for chapters 1, 2, 3, 5.5, 5.6
    • Any Python textbook, see notes on 9/15 for exam topics

Thu, Sep 22

Decision Making

Cipher Lab Recap

Conditional (if) statements

  • Textbook 4.1,4.2

The Great Game

Assignments

  • Bring a complete Automating the Player algorithm (human level) to lab

Fri, Sep 23

Lab

  • Collage showcase
  • Tic Tac Toe playoff

  • Lab assignments (due Thu)

    Tue, Sep 27

    Repetitive Actions

    Conditional (if) statements con't

    Lab Follow-Up

    Hangman Example

    • Pseudo-code algorithms
    • Identifying constant and variable data (state)
    • while loops
      • Textbook 5.1-5.3,5.7
    • hangman.py

    Assignments

    • Finish labs for Thu

    Thu, Sep 29

    Finishing Hangman

    • Using while-True and break
    • Counting loops vs. for all items in a list
    • Effective testing
    • Debugging strategies: narrowing in

    if-else trees

    • Textbook 4.3

    Fri, Sep 30

    Tue, Oct 4

    Complex Decisions

    Winning Tic Tac Toe

    • Enumerating the win conditions
    • Complex conditions
    • Generalizing regularity
    • Avoiding hardcoded data

    Practice Problems Review

    Thu, Oct 6

    Practice Problems Review

    File I/O

    • Textbook chapter 12

    Fri, Oct 7

    Lab

    Module 2 Exam

    format()

    • Note: Textbook (3.7) uses old-style formatting, do not follow

    Lab assignments (due Thu)