我的整数输入是假设12345,我想拆分并将其放入数组中1, 2, 3, 4, 5.我怎么能这样做?
12345
1, 2, 3, 4, 5
python
我如何编写magic下面的功能?
magic
>>> num = 123 >>> lst = magic(num) >>> >>> print lst, type(lst) [1, 2, 3], <type 'list'>
python integer list
如何将int转换为其数字列表,例如.
a = 1234
我必须用它作为
[1,2,3,4]
我试过用
表(一)
但它显示错误.我可以使用其他任何东西
python list python-2.7 python-3.x
python ×3
list ×2
integer ×1
python-2.7 ×1
python-3.x ×1