Skip to content

Instantly share code, notes, and snippets.

@y16ra
Created September 28, 2016 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save y16ra/af2e21dd9b15c01c09e6c136282fd582 to your computer and use it in GitHub Desktop.
Save y16ra/af2e21dd9b15c01c09e6c136282fd582 to your computer and use it in GitHub Desktop.
数値の桁数を求める
import math
n = 100
digits = int(math.log10(n) + 1) # 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment