title: Why is my code for finding number of sets in a binary not working?
body: <pre><code>count=0
  n=int(input())
  while(n!=0):
      if n&amp;1&gt;0:
          count+=1
         
      n = n &gt;&gt; 1
  print(count)
  </code></pre>
  <p>I want to find number of set bits in a binary but my code doesn't seem to work . Why?</p>