0
def nod(n):
        c,i=0,0
        while n>0:
                c=n%10
                if c!=0:
                        i=i+1
                n=n//10
        print(i)#prints the number of digits in the given integer 'n'

how to make it able to count 'zeros'?

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Beat_Slayer
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.