Chapter 14: Data Types
Learning with AI as Your Partner
In Chapter 13, you learned what Python is and ran your first Hello World program using print(). Now it's time to learn how to store data in variables and understand what types are and why they matter.
What You'll Learn
By the end of this chapter, you will:
- Create variables with type hints to store different kinds of data
- Understand what a data type is and why Python uses them
- Work with core types:
int,float,str,bool, andNone - Explore collections (list, tuple, dict, set) at awareness level
- Build an interactive type explorer demonstrating all concepts
AI-Native Learning Approach
This chapter teaches data types through AI partnership, not syntax memorization:
- Describe intent: Type hints describe what data means (
age: int= "age is a number") - Explore with AI: Ask AI "what can I do with this type?" instead of reading documentation
- Validate together: Use
isinstance()andtype()to check understanding - Learn from errors: When
TypeErroroccurs, ask AI "why?" to deepen learning
Chapter Structure
Lesson 1: Variables and Type Hints
Learn to store data in variables with type hints, building on Chapter 13's Hello World knowledge.
Duration: 45 minutes Skills: Understanding Variables (A2), Writing Type Hints (A2), Describing Intent (B1)
Lesson 2: Understanding Data Types - Integers and Floats
Understand the type concept and explore numeric types (int, float) through AI dialogue.
Duration: 50 minutes Skills: Data Type Concept (A2), Numeric Types (A2), Type Inspection (A2-B1)
Lesson 3: Strings and Booleans - Text and Truth
Learn text basics (str), boolean logic (bool), None, and type conversion.
Duration: 50 minutes Skills: String Basics (A2), Boolean Logic (A2-B1), Type Conversion (B1)
Lesson 4: Introduction to Collections - Overview Only
Gain awareness of collections (list, tuple, dict, set) - comprehensive coverage in Chapters 18-19.
Duration: 40 minutes Skills: Collection Awareness (A1-A2)
Lesson 5: Building a Type Explorer - Hands-On Practice
Build an interactive type explorer applying all core type concepts (capstone project).
Duration: 50 minutes Skills: Integration (B1), Type Validation (B1), AI-Guided Improvement (B1)
Prerequisites
Before starting this chapter, you should have completed:
- Chapters 1-4: AI-Native development mindset (Nine Pillars, AI as learning partner)
- Chapters 5-11: AI tool literacy (Claude Code, Gemini CLI, prompting, context engineering)
- Chapter 12: Python UV package manager (installation and environment setup)
- Chapter 13: Introduction to Python (What is Python + Installing Python + Hello World)
What's Next
After completing this chapter, you'll be ready for:
- Chapter 15: Operators, Keywords, and Variables (what you DO with types)
- Chapter 16: Strings and Type Casting (string methods and formatting)
- Chapter 17: Control Flow and Loops (if/else, while, for)
Total Time: 3.5-4 hours across 5 lessons