Python Wiki
Advertisement

Integers are one of the primitive, numeric data types in Python.
Integers represent whole numbers. The range of these numbers is from until (the default range for integers on 32-Bit computers).
As Python has the automatic type-inference, it will interpret all numerics withought digits-after-the-comma as integers.

Casting[]

To cast a numeric variable to an integer, type:

int(your_variable)
Advertisement