Skip to content

Module 2 Overview

Module 2: Variables and Data Types shifts our focus from the environment to the language itself. At the heart of every program lies data—numbers, text, and logic states.

In this module, we will explore Python’s unique approach to variable management (the Reference Model), which differs significantly from languages like C or Java. We will then dive deep into the fundamental building blocks of data: the primitive types.

By the end of this module, you will be able to:

  • Explain Python’s “Reference Model” and how it differs from the “Box Model” of variables.
  • Identify and utilize the four primary primitive data types: int, float, bool, and str.
  • Apply arithmetic, logical, and comparison operators to control program logic.
  • Perform advanced string manipulations, including slicing, formatting, and method application.
  • Safely convert data between different types using explicit type casting.