Write a program to count the total number of digits in a number?

def count_digits(n):
return len(str(n))

num = 12345
print(count_digits(num))

2 Likes

@A_Abhiram

correct, keep it up.

@A_Abhiram very good :+1: keep it up

Try taking input from user that will create a good impression.

1 Like