Advertisement
Egor_1425

Untitled

May 5th, 2024
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.09 KB | None | 0 0
  1. n = int(input())
  2. count = 0
  3. while n > 0:
  4.     count += n & 1
  5.     n >>= 1
  6. print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement