Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Beginning Zeros solution in Uncategorized category for Beginning Zeros by Mateusz_Wryszcz
def beginning_zeros(numbers: str) -> int:
result = 0
for number in numbers:
if int(number) == 0:
result += 1
else:
return result
return result
print("Example:")
print(beginning_zeros("10"))
assert beginning_zeros("100") == 0
assert beginning_zeros("001") == 2
assert beginning_zeros("100100") == 0
assert beginning_zeros("001001") == 2
assert beginning_zeros("012345679") == 1
assert beginning_zeros("0000") == 4
print("The mission is done! Click 'Check Solution' to earn rewards!")
Nov. 28, 2022