Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for End Zeros by eegoldstraw
def end_zeros(num: int) -> int:
# your code here
num_str=str(num)
num_str=num_str[::-1]
count=0
#make number into a string and reverse it.
#for each character count the number of zeros
#stop counting when you find a digit that is not a zero
for i in num_str:
if i=='0':
count+=1
else:
break
return count
March 30, 2020
Comments: