Binary numbers in Python

前端 未结 9 2126
孤独总比滥情好
孤独总比滥情好 2020-12-04 11:14

How can I add, subtract, and compare binary numbers in Python without converting to decimal?

9条回答
  •  鱼传尺愫
    2020-12-04 11:49

    Binary, decimal, hexadecimal... the base only matters when reading or outputting numbers, adding binary numbers is just the same as adding decimal number : it is just a matter of representation.

提交回复
热议问题