PYTHON DATA
TYPES
NUMBER DATA TYPES
• Integer (int): Whole numbers → a = 25
• Float (float): Decimal numbers → x = 3.14
• Complex (complex): Real + Imaginary → z = 2 + 3j
• Immutable
BOOLEAN DATA TYPE
• Boolean (bool) represents truth values
• Values: True, False
SEQUENCE DATA TYPES
• String (str): Characters, Immutable → 'Hello'
• List (list): Ordered, Mutable → [10, 20, 'apple']
• Tuple (tuple): Ordered, Immutable → (1, 2, 3)
NONE DATA TYPE
• None represents absence of value
• Example: result = None
MAPPING DATA TYPE
• Dictionary (dict): Key–Value pairs, Mutable
• Example: student = {'name': 'Amit', 'age': 16, 'class': '10th'}
MUTABLE VS
IMMUTABLE
• Mutable (can change): list, dict, set
• Immutable (cannot change): int, float, complex, str, tuple, bool,
None
SUMMARY TABLE
• Number → int, float, complex
• Boolean → bool
• Sequence → str, list, tuple
• None → NoneType
• Mapping → dict
• Mutable → list, dict, set
• Immutable → int, float, complex, str, tuple, bool, None
CONCLUSION
• Python supports multiple data types
• Helps in organizing and processing data efficiently
• Knowing mutable vs immutable is important