为什么将第一行改为nums=input()系统会报错
nums =odds = []
evens = []
result = []
for each in nums:
if each % 2 != 0:
odds.append(each)
else:
evens.append(each)
odds.sort()
evens.sort()
result = odds + evens
print(result) input() 字符串。
>>> nums = list(eval(input()))
1, 23, 1
>>> nums
页:
[1]