tilde operator and negative number in Python

前端 未结 0 1318
有刺的猬
有刺的猬 2020-12-30 18:23

I thought ~(tilde) makes the given number\'s bit in reversed. The result is different from what I expected.

two = 2
tildeTwo = ~2
print("two:",f&quo         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题