Chapter 11 · Foundations Foundations Track CLI Project

Python for testers: twelve runnable lessons, zero dependencies, straight to AI-agent fluency.

The exact Python a QA engineer needs before touching agents: variables and identifiers, keywords, literals, operators, strings, lists, tuples and dicts, each as a standalone file you run and read, ending with your first LLM prompt built in code.

01 What students build

Not a slide deck: a folder of 12 numbered .py files, each a self-contained lesson with inline comments and a quick-reference table. You run python3 05_Identifier.py, read the output next to the source, and move on. The sequence is deliberate: names first (identifiers, keywords, case styles), then values (literals), then actions (operators), then the two workhorses of test code, strings and collections.

Lessons as Files

01_Hello_Python through 12_Tuple. Every concept is runnable, commented, and shows input → output on the line where it happens.

QA-flavoured Examples

Strings lesson cleans a messy login URL, dict lesson models a test case record, so nothing feels like abstract textbook code.

Bridge to AI

Lesson 04 builds an LLM prompt with f-strings and model-name variables, the exact pattern every later agent chapter reuses.

02 Architecture

01-04hello · vars · LLM query
──▶
05-07identifiers · keywords · case
──▶
08literals
──▶
09operators
──▶
10strings
──▶
11-12list · dict · tuple
names → values → actions → text → collections · each box is runnable .py files

03 Live demo (simulated with sample data)

This is a UI walkthrough with pre-baked sample output so you can preview the lessons in the browser. In the course you run each file for real: python3 10_Strings.py in your terminal, nothing to install.

python3 · Chapter_11_Python_Learning demo · sample data

04 Inputs & outputs

What goes in

  • Just Python 3, no pip installs, no virtualenv required
  • One numbered lesson file at a time, in order
  • Your own edits: change a value, rerun, see what breaks
  • The README cheat sheet mapping concept → file

What comes out

  • Terminal output annotated line-by-line in the source
  • A working mental model: identifier vs literal vs keyword
  • String and collection fluency for test data wrangling
  • A first LLM prompt assembled with f-strings
  • Muscle memory for python3 file.py before any framework

05 How it's built

Start with 01-03: print, variables and types, conversions and input/output, the bare minimum to run anything.
Jump straight to 04_AIAGent_Query.py: store model names in variables and assemble an LLM prompt with an f-string, motivation before grammar.
Learn the naming rules in 05-07: identifier rules, the 35 reserved keywords via keyword.kwlist, and case styles from snake_case to dunder.
Cover every literal type in 08: numbers in bin/oct/hex, raw and byte strings, bool, None, collections, even Ellipsis and inf/nan.
Work through 09's operator categories: arithmetic, walrus, comparison, logical, bitwise, identity, membership and unpacking.
Finish with 10-12: the full string-method reference on a QA URL example, then lists, tuples and dicts as test-data containers.

06 Tech stack

Python 3Zero dependencies12 runnable lessonsf-stringskeyword.kwliststr methodslist · tuple · dictPEP 8 naming