3. Data Types

Python has several built-in data types. Here are the most commonly used ones:

  • int: Whole numbers (e.g., 10, -5).
  • float: Numbers with a decimal point (e.g., 3.14, -5.99).
  • str: Text (strings of characters) (e.g., "Alice", "Hello").
  • bool: Boolean values True or False.

Example:


age = 25      # int
height = 5.9  # float
name = "Alice"  # str
is_active = True  # bool