Python int() function
The Python int() method converts a specified expression to an integer, making it essential for type conversion and base-to-decimal transformation - RRTutors.
The int() method in Python returns the numeric integer equivalent of a specified expression. An integer can be returned from a given object using the Python int() method or converted from a specified base to decimal using the int().
Syntax
Int(string, base) |
Where:
String comprises of 0’s and 1’s
Base refers to the integer value which represents the base of the number
Example
x = '10000' |
Output
10000 with base 2 = 16 |