Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5cb1f40

Browse files
committedOct 15, 2024·
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 93aebc6 commit 5cb1f40

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed
 

‎maths/trailing_zeroes.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""
2-
https://en.wikipedia.org/wiki/Trailing_zero
2+
https://en.wikipedia.org/wiki/Trailing_zero
33
"""
44

55

66
def trailing_zeroes(num: int) -> int:
77
"""
88
Finding the Trailing Zeroes i.e. zeroes present at the end of number
9-
9+
1010
Args:
1111
num: A integer.
1212
@@ -23,19 +23,18 @@ def trailing_zeroes(num: int) -> int:
2323
0
2424
"""
2525
ans = 0
26-
27-
if(num == 0) :
26+
27+
if num == 0:
2828
return 1
29-
30-
while(num > 0) :
31-
32-
if(num%10 == 0) :
33-
ans+=1
34-
else :
29+
30+
while num > 0:
31+
if num % 10 == 0:
32+
ans += 1
33+
else:
3534
break
36-
35+
3736
num /= 10
38-
37+
3938
return ans
4039

4140

0 commit comments

Comments
 (0)
Please sign in to comment.