代码展示:
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> bin(9)
'0b1001'
>>>
>>> int('18234')
18234
>>> int('100',base=10)
100
>>> int('100',base=9)
81
>>> int('100',base=8)
64
>>> int('100',base=6)
36
>>> int('100',base=7)
49
>>>
>>> hex(32)
'0x20'
>>>
>>> oct(12)
'0o14'
>>>
>>> eval('0x20')
32
>>> eval('0o14')
12
>>>
>>> int('010')
10
>>>
>>>