计划输入默认值是的raw_input不无当没有输入
default = [1,2,3,4] # Passing default list
L = raw_input("Enter a list of numbers separated by comma:")
m = L.split(",") # Spliing the list
if raw_input == None: # If someone doesn't enter ANY INPUT
raw_input = default
print default # Trying to print default input
else:
print list(m)
输出:
Enter a list of numbers separated by comma : [PRESS ENTER]
Result:['']
刚才你的问题是什么? –