PythonNumberint

Converts a value to an integer.

Syntax

int(x)

Example

Enter values below to update the example in real time.

print
print(int("42"))     # 42
print(int(3.99))     # 3
print(int("FF", 16)) # 255