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 @   运维小菜鸟的开发之路  阅读(315)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示