Chapter 3

Variables & Basic Types

variablesstringsnumbersbooleansf-strings

Learning Path

Hands-on Labs

Each objective has a coding lab that opens in VS Code in your browser

Objective 1

Create and name variables

Goal

You will learn to create variables with meaningful names following Python conventions. Understand snake_case naming, reassigning values, and the rules for valid variable names.

Objective 2

Work with strings

Goal

You will master string manipulation in Python. Create and concatenate strings, use common string methods like upper(), lower(), and strip(), and work with multi-line strings using triple quotes.

Objective 3

Work with numbers

Goal

You will work with numeric types in Python. Perform arithmetic operations, understand the difference between integers and floats, and use integer division and modulo operators.

Objective 4

Work with booleans

Goal

You will understand boolean values and logical operations. Create boolean flags, use comparison operators (==, !=, <, >), and combine conditions with and, or, and not.

Objective 5

Format with f-strings

Goal

You will use f-strings for powerful string formatting. Create basic f-strings with variable interpolation, format numbers with precision, and build dynamic prompts that will be useful for LLM interactions.