class int(x, base=10)
Returns an integer object. 0 is returned by default.
The parameter x can be a string or a floating point number.
Base refers to the hexadecimal form of x, such as 2 for binary and 10 for decimal. In particular, it should be noted that 0 represents any base.
>>> int('123',10) 123 >>> int('123',0) 123 >>> int('0x123',16) 291 >>> int('0x123',0) 291