title: Negative numbers to binary system with Python
body: <p>I'm solving a task using Python. 
  I need to count the number of non-zero bits in a given value. I don't have any problems with positive numbers as I use the function bin() and count the number of '1', but can't understand what's wrong with negative. In example, -1 is equal to <code>11111111111111111111111111111111</code>, but when I use the function bin() it gives '-0b1'. Please, tell me how can I convert it right.</p>