integer
Data typesWhat this creature is
An integer is a whole number (no decimal part). You use it for counting, indexing, and math where fractions are not needed.
Why you will regret ignoring it
List positions, scores, and loop counts are often integers. Mixing integers and floats on purpose is fine; mixing them by accident causes bugs.
Example
items = 3
total = items + 2
Common disgrace
Expecting division of two integers to behave like “real” division in every case — in Python 3, / gives a float; use // for integer division when you need it.
Trial by code
Set a variable to 10, subtract 3, and print the result.