- int
num = "0011" a = int(num, base=2) print(a) # 3 num2 = "a" b = int(num2, base=16) print(b) # 10
- bit_length
本文共 191 字,大约阅读时间需要 1 分钟。
num = "0011" a = int(num, base=2) print(a) # 3 num2 = "a" b = int(num2, base=16) print(b) # 10
转载于:https://www.cnblogs.com/sidaofeng/p/10867545.html