S = "1234"# 直接遍历字符串,每个字符转整数L = [int(x) for x in S]print(L)
Standard input is empty
[1, 2, 3, 4]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!