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

 


posted @ 2019-05-15 09:26  运维小菜鸟的开发之路  阅读(315)  评论(0编辑  收藏  举报