int

Cast value to integer (truncates decimal part).

Syntax

int(value, /)

Parameters

NameDescription
valueInt | Float | Boolean | String
Value to cast
Required · Positional only
No default

Returns

Int — Converted integer value.

Example

threshold = int(3.9)
text(str(threshold))