Table of Contents
十进制转二进制
>>> bin(100) '0b1100100'
十进制转八进制
>>> oct(100) '0144'
十进制转十六进制
>>> hex(100) '0x64'
二进制转十进制
>>> i = "11110" >>> int(i,2) 30
八进制转十进制
>>> c = '0144' >>> int(c,8) 100
十六进制转十进制
>>> c = '0x64' >>> int(c,16) 100
Table of Contents
>>> bin(100) '0b1100100'
>>> oct(100) '0144'
>>> hex(100) '0x64'
>>> i = "11110" >>> int(i,2) 30
>>> c = '0144' >>> int(c,8) 100
>>> c = '0x64' >>> int(c,16) 100
评论前必须登录!
注册