Sahaj.blogs

Day page

11 Aug 2023

Study

Python · Types: int, float, bool, None

Python's basic scalar types, why 0.1 + 0.2 is not exactly 0.3, and how None differs from False.

  • Python ints have arbitrary precision, so they never overflow.
  • Floats are binary approximations, so compare them with math.isclose, not ==.

Read the post →