标签: python
刚刚启动python并且需要二进制来进行denary(反之亦然)但是得到int的无效语法(。
答案 0 :(得分:2)
这很奇怪,这很好用:
int('0b10101010', 2) => 170
这样做:
bin(170) => '0b10101010'