python--取数字个十百位方法

方法一:根据除、余取

百:(int(i/100))
十:int(i%100/10)
个:i%100%10

方法二:int转str,再用list转,

a=258
b=list(str(a))
b=[2,5,8]



原文地址:https://www.cnblogs.com/guang2508/p/12889542.html