python中将数字字符串拆分为单个的字符

小鲨鱼2018 / 2023-09-01 / 原文

 

001、

>>> str1 = "2354365"
>>> digit1 = [int(i) for i in str1]
>>> digit1
[2, 3, 5, 4, 3, 6, 5]