group = 0
position = 0
end = "n"
while (end == "n"):
group = group + 1
xy = [[] for xy in range(group)]
xy[position].append(int(input("Input x value: ")))
xy[position].append(int(input("Input y value: ")))
position = position + 1
end = input("Last entries? [y/n] ")
print (xy)
输出
Input x value: 1
Input y value: 2
Last entries? [y/n] n
Input x value: 3
Input y value: 4
Last entries? [y/n] y
[[], [3, 4]]
我的第一个清单不见了,我不明白为什么。如何解决这个问题?
holdtom
绝地无双
相关分类