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

 

001、

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

 

posted @ 2023-09-01 09:39  小鲨鱼2018  阅读(71)  评论(0编辑  收藏  举报