🇺🇦 Python Programming Сhallenges
1.04K subscribers
3 photos
2 files
63 links
Размышления на тему решения различных задач по спортивному программированию на Python и не только.
加入频道
Found very intersting approach to count the digits of an integers #python:

from math import floor, log10


def count_digits(n):
return 1 + floor(log10(n))

In [2]: count_digits(5)
Out[2]: 1

In [3]: count_digits(999)
Out[3]: 3

In [4]: count_digits(1000)
Out[4]: 4