Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What data type does int stand for in python?
What data type does int stand for in python?
Python int () function is used to convert strings or numbers into integers.

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