Number of 1 bits excercise.
Could someone tell me what I'm doing wrong?
Input - 00000000000000000000000000001011
Your Answer - 2
Correct Answer - 3
Meanwhile when testing locally I'm getting the answer 3.
class Solution(object):
def hammingWeight(self, n):
"""
"""
output = 0
y = list(str(n))
for i in y:
if i == "1":
output+=1
return output