grammar
The following is the syntax of the Python int () function:
Class int(x, base= 10)
parameter
X string or number
Decimal number, default decimal number.
Return value
Returns integer data
example
The following shows an example of using the int () method:
& gt& gt& gt When int() # does not pass in parameters, the result is 0.
& gt& gt& gtint(3)
three
& gt& gt& gtint(3.6)
three
& gt& gt& gtInt(' 12', 16) # If there is a parameter base, 12 should be entered as a string, and 12 is 16.
18
& gt& gt& gtint('0xa ', 16)
10
& gt& gt& gtint(' 10 ',8)
eight