ID EN
Built-in Functions

int

Python 3.11

Return an integer object constructed from a number or string x, or return 0 if no arguments are given. If x defines __int__(), int(x) returns x.__int__(). If x defines __index__(), it returns x.__index__(). If x defines __trunc__(), it returns x.__trunc__(). For floating point numbers, this truncates towards zero.

Syntax

PYTHON
class int(x=0)

See Also

__int__() __index__() __trunc__() bytes bytearray integer literal in code Numeric Types — int float complex int