Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- count = 0
- while n > 0:
- count += n & 1
- n >>= 1
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement