!!!Python 数値の桁数を得る [Python]{{category ロジック}} import math >>> n = 12345 >>> int(math.log10(n) + 1) 5