Python int() Function
The int() function converts the specified value into an integer
number.
Syntax
int(value, base)
Parameters
| Parameter | Description |
|---|---|
value |
Required. A number or a string that can be converted into an integer object |
base |
Optional. The number representing the number format. Default value: 10 |
Return Value
An integer object.
Example
Using the int() function:
Output
Click Run to execute your code
Enjoying these tutorials?