Skip to content

Commit f1c3214

Browse files
Merge pull request #755 from behzadshomali/patch-2
Update totaldigits.py
2 parents 75d35e4 + ae9a320 commit f1c3214

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)