I am trying to write a function that returns the number of trailing 0s in a string or integer. Here is what I am trying and it is not returning the correct values.
if you want to count how many zeros at the end of your int:
def end_zeros(num):
new_num = str(num)
count = len(new_num) - len(new_num.rstrip("0"))
return count
print(end_zeros(0)) # == 1
print(end_zeros(1)) # == 0
print(end_zeros(10)) # == 1
print(end_zeros(101)) # == 0
print(end_zeros(245)) # == 0
print(end_zeros(100100)) # == 2