Skip to content

Instantly share code, notes, and snippets.

@threecifanggen
Created December 24, 2021 05:59
Show Gist options
  • Select an option

  • Save threecifanggen/e660afc3f3d0abe30ee028eb18f9b478 to your computer and use it in GitHub Desktop.

Select an option

Save threecifanggen/e660afc3f3d0abe30ee028eb18f9b478 to your computer and use it in GitHub Desktop.
[Python 拆分整数] 用python拆分整数的函数 #python
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