Skip to content

Commit ae9a320

Browse files
Update totaldigits.py
1 parent 75d35e4 commit ae9a320

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

totaldigits.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# To Find The Total Number Of Digits In A Number
22

3-
N = int(input("Enter The number"))
4-
count = 0
3+
N = int(input("Enter The number")) # To remove zeros before the number
4+
count = len(str(N))
55

6-
while(N!=0):
7-
N = (N-N%10)/10
8-
count+=1
9-
10-
11-
print(count)
6+
print(count)

0 commit comments

Comments
 (0)