Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Code to count the digits
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import math

def countDigit(n):
return math.floor(math.log(n, 10)+1)

# Driver Code
n = 345289467
# if want user input
# n = int(input())
print ("Number of digits : % d"%(countDigit(n)))