“`”

 

<pre><code class=""language-python"" lang=""python"">def count_digit(number):
return len(str(number))

def countThree(digit):
if not isinstance(digit,int):
raise TypeError('number is not int')
# digit = len(str(number))
if(digit <=0):
return 0
if(digit ==1):
return 1
return 10*countThree(digit-1) + 10 **(digit-1)

print(countThree(count_digit(9999)))
</code></pre>

<pre><code> "“`

Was this helpful?

0 / 0

发表回复 0

Your email address will not be published.