「Python 数値の桁数を得る」の版間の差分
ナビゲーションに移動
検索に移動
(ページの作成:「==Python 数値の桁数を得る== [Python]{{category ロジック}} import math >>> n = 12345 >>> int(math.log10(n) + 1) 5」) |
|||
(同じ利用者による、間の2版が非表示) | |||
1行目: | 1行目: | ||
− | ==Python 数値の桁数を得る== | + | ==[[Python 数値の桁数を得る]]== |
− | [Python] | + | [[Python]] | [[Category:ロジック]] |
import math | import math | ||
− | + | >>> n = 12345 | |
− | + | >>> int(math.log10(n) + 1) | |
5 | 5 |
2020年2月16日 (日) 04:31時点における最新版
Python 数値の桁数を得る
Python |
import math >>> n = 12345 >>> int(math.log10(n) + 1) 5
© 2006 矢木浩人