Taking into account @OldBill 's comment & answer:
I corrected the code so that it gives an answer taking into account both of Op's problem.
The counting of the trailing zero is @OldBill 's code and not mine.
With
list = input("Enter the number: ")
p = print("Trailing zeroes = ")
print(p, list.count("0"))
What you do is p = print("Trailing zeroes = ")
which is not a value. That explains the None
when you print p
.
Plus your counting of trailing zero doesn't work, and count all zeroes.
To have your code working, either you should have
num = input('Enter number: ')
ntz = len(num)-len(num.rstrip('0'))
print(f'Your input has {ntz} trailing zeroes')
or
num = input('Enter number: ')
print('Your input has', len(num)-len(num.rstrip('0')),' trailing zeroes')