【发布时间】:2021-11-21 06:12:33
【问题描述】:
我正在尝试制作一个读取并执行以下条件的程序,我该怎么做?
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[]
【问题讨论】:
-
请解释您的问题与您使用的标签
[python-requests]有何关系? -
添加您尝试过但没有奏效的内容:我在这里看不到任何问题。顺便说一句,
map(str, input().split()的作用也不过是input().split()。你想更普遍地做什么?这和python-requests有什么关系? -
我不太准确:
map(str, input.split()确实做了一些事情——它浪费了 cpu 周期将 strs 转换为 strs。但是 input.split() 的输出已经是一个字符串列表 -
input正在返回字符串,因此无需再次转换:map(str, input().split())->input().split()` -
a3,b2,c3 : 这应该是 a3, b3,c3 吗?
标签: python python-3.x list while-loop