二进制,八进制,十六进制
程序员文章站
2022-03-08 17:27:40
...
a = 1234
b = bin(a) # 字符串 0b10011010010
c = 0b10011010010
d = int(c) # 1234
e = hex(a) # 字符串 0x4d2
f = 0X4D2
g = int(f) # 1234
h = oct(a) # 字符串 02322
i = 02322
j = int(i) # 1234