🌈 搜索
📅  最后修改于: 2022-03-11 14:46:28.252000             🧑  作者: Mango
import math def first_n_digits(num, n): return num // 10 ** (int(math.log(num, 10)) - n + 1)