3Data Types

Data types are the foundation of programming β€” they define what kind of values a variable can hold and what operations can be performed on them. In Python, understanding data types is essential for:

  • Writing correct and efficient code

  • Avoiding bugs (e.g., trying to add a string to an integer) and possible crashes

  • Optimizing memory and performance

  • Critical for certain industries or businesses (Money, Hospitals etc.)


Numeric Types

  • int = 10 | Whole Numbers

  • float = 13.37 | Decimal Numbers

  • str = "hello" | Strings/Text

  • complex = "2 + 3j" | Complex Values


Boolean

0 False where 1 is True.

  • is_active = True (1)

  • is_active = False(0)


Sequence Types

Last updated