[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-10-13 14:37:39 +00:00
parent ab7bcb99bc
commit 5d49809fd5

View File

@ -48,14 +48,14 @@ if __name__ == "__main__":
def count_zeros_and_ones(binary_number):
# Convert the binary number to a string if it's not already
binary_str = str(binary_number)
count_zeros = binary_str.count('0')
count_ones = binary_str.count('1')
count_zeros = binary_str.count("0")
count_ones = binary_str.count("1")
return count_zeros, count_ones
# Example usage
binary_number = 1011001
zeros, ones = count_zeros_and_ones(binary_number)
print(f"Number of 0s: {zeros}, Number of 1s: {ones}")