Skip to main content
 首页 » 编程设计

python之如何在 python 中将数字转换为数字列表

2025年05月04日15bjzhanghao

<分区>

Possible Duplicate:
How can I get a list as input from the user in Python?

我目前有这个:

c = eval(input("Enter a group of numbers ")) 
#say someone types 123 
print (c) 
#prints out 123 

我想要这个:

c = eval(input("Enter a group of numbers ")) 
#say they enter 123 
print (c) 
#prints out [1,2,3] 

我希望 123 以 [1,2,3] 结束。我该怎么做?