Skip to content

Commit 66babd6

Browse files
committed
count of digits in a number
1 parent 95324cc commit 66babd6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

digits_in_number.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
__author__ = 'Avinash'
2+
3+
input_num = int(input("Enter any number: "))
4+
5+
count = 0
6+
while input_num > 0:
7+
count += 1
8+
input_num //= 10
9+
print("The number of digits in the given number are:", count)

0 commit comments

Comments
 (0)