warming up your workspace

Python Foundations through Compilers & Interpreters

Never written code before? Start here. You will learn the absolute basics of Python, output, variables, types, decisions, loops, and functions, using tokens, source characters, keywords, parsing, and line counts as your playground. By the end you are ready for Project 1.

First words

  1. Display your first scanner message
  2. Display token and line counts
  3. Add comments for the reader
  4. Join and store keyword text
  5. Calculate average tokens per line

Remembering things

  1. Store a token count in a variable
  2. Update a running token count
  3. Choose types for counts, labels and flags
  4. Convert a character count from text
  5. Name the fields in a token summary

Making choices

  1. Compare a keyword count with a threshold
  2. Display a message when a flag is true
  3. Choose between two parsing messages
  4. Choose a label for a token-count range
  5. Combine two report flags

Doing it again

  1. Repeat a countdown with while
  2. Visit line numbers with for and range
  3. Accumulate a character count
  4. Stop a loop when its work is finished
  5. Visit a grid of line and column numbers

Many values and reuse

  1. Store and look up token lengths
  2. Find the largest token length
  3. Define a function that returns an average
  4. Count matching token labels with a function
  5. Build a token-length summary

Explore the full field