Phase 1: Programming Fundamentals I · ~35 minutes · Python · uv
Variables, Types, and the Assignment Trap
x = x + 1 isn't an equation. It's an instruction: compute the right side first, then re-tie the name to the answer.
Hiring signal: Reads a TypeError from mixed-type concatenation and fixes it with explicit conversion instead of guessing
What you will learn
- Explain what a variable actually is: a name bound to a value, not a labeled box that holds it
- Identify the four everyday types: int, float, str, bool, and what type() reports for each
- Explain what Python's dynamic typing does and doesn't mean
- Diagnose and fix a real TypeError caused by mixing incompatible types
- Predict the value and type at each step of a chain of reassignments
Introduction
Type: Learn Languages: Python Prerequisites: Phase 00 (How Computers Actually Work) Time: ~35 minutes
Objective
Learning objectives
- Explain what a variable actually is: a name bound to a value, not a labeled box that holds it
- Identify the four everyday types —
int, float, str, bool — and what type() reports for each - Explain what Python's dynamic typing does and doesn't mean
- Diagnose and fix a real
TypeError caused by mixing incompatible types - Predict the value at each step of a chain of reassignments
What you're building
A script (types_and_assignment.py) that:
- Uses
type() to print the type of one int, one float, one str, and one bool value, each clearly labeled - Shows the exact
TypeError from mixing str and int with + — as a comment showing what the broken line and its error looked like — directly followed by the real, working, corrected version using str() - A chain of at least three reassignments to the same variable name, with a comment after each line stating its value at that point
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers The Problem, Check Yourself, Key Terms & Next — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy