如何在不满足给定条件时创建一系列变量并将它们存储在列表中?
How to create a sequence of variables and store them in lists while a given condition is not met?
我正在尝试制作一个读取并执行以下条件的程序,我该怎么做?
while condition not met:
a1,b1,c1 = map(str, input().split())
a2,b2,c2 = map(str, input().split())
a3,b3,c3 = map(str, input().split())
...
...
...
a1, a2, a3 stored in list1[]
b1, b2, b3 stored in list2[]
c1, c2, c3 stored in list3[]
错误的方法
list = [][]
while condition not met:
a, b, c = map(str, input().split())
list[0].append(a)
list[1].append(b)
list[2].append(c)
a1, a2, a3 ...
将存储在 list[0]
b1, b2, b3 ...
将存储在 list[1]
c1, c2, c3 ...
将存储在 list[2]
我正在尝试制作一个读取并执行以下条件的程序,我该怎么做?
while condition not met:
a1,b1,c1 = map(str, input().split())
a2,b2,c2 = map(str, input().split())
a3,b3,c3 = map(str, input().split())
...
...
...
a1, a2, a3 stored in list1[]
b1, b2, b3 stored in list2[]
c1, c2, c3 stored in list3[]
错误的方法
list = [][]
while condition not met:
a, b, c = map(str, input().split())
list[0].append(a)
list[1].append(b)
list[2].append(c)
a1, a2, a3 ...
将存储在 list[0]
b1, b2, b3 ...
将存储在 list[1]
c1, c2, c3 ...
将存储在 list[2]