Python Variables & Data Types

Think of variables as little kitchen containers, each holding a specific ingredient. Let's learn how to organize your code!

📦

Variables as Containers

A variable is just a name you give to a spot in your computer's memory. You use the `=` sign to put data into that box.

🧬

The Basic Types

  • • int: Whole numbers (1, 100)
  • • float: Decimals (1.5, 3.14)
  • • str: Text ("Hello!")
  • • bool: True or False

Collection Types

List

Mutable (changeable) collection of items like [1, 2, 3].

Tuple

Immutable (locked) collection like ('a', 'b').

Dict

Key-value pairs for smart data searching.