python-数字(int)知识整理 int num = "0011" a = int(num, base=2) print(a) # 3 num2 = "a" b = int(num2, base=16) print(b) # 10 bit_length 我的目标是每天厉害一点点