Created
December 24, 2021 05:59
-
-
Save threecifanggen/e660afc3f3d0abe30ee028eb18f9b478 to your computer and use it in GitHub Desktop.
[Python 拆分整数] 用python拆分整数的函数 #python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import List | |
| from math import log10, ceil | |
| def split_int(a: int) -> List[int]: | |
| retrurn [a // 10 ** i % 10 for i in range(ceil(log10(a))-1, -1, -1)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment