take in 1 integer return a number that is the number of 1 s in binary representation of that number binarycountsetbits25 3 binarycountsetbits36 2 binarycountsetbits16 1 binarycountsetbits58 4 binarycountsetbits4294967295 32 binarycountsetbits0 0 binarycountsetbits10 traceback most recent call last valueerror input value must be a positive integer binarycountsetbits0 8 traceback most recent call last typeerror input value must be a int type binarycountsetbits0 traceback most recent call last typeerror not supported between instances of str and int take in 1 integer return a number that is the number of 1 s in binary representation of that number binary_count_setbits 25 3 binary_count_setbits 36 2 binary_count_setbits 16 1 binary_count_setbits 58 4 binary_count_setbits 4294967295 32 binary_count_setbits 0 0 binary_count_setbits 10 traceback most recent call last valueerror input value must be a positive integer binary_count_setbits 0 8 traceback most recent call last typeerror input value must be a int type binary_count_setbits 0 traceback most recent call last typeerror not supported between instances of str and int
def binary_count_setbits(a: int) -> int:
    
    if a < 0:
        raise ValueError("Input value must be a positive integer")
    elif isinstance(a, float):
        raise TypeError("Input value must be a 'int' type")
    return bin(a).count("1")


if __name__ == "__main__":
    import doctest

    doctest.testmod()