如何在Python中并行计数2列表?
我有两个列表。
Numbers = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
Letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
我想并行计算这两个列表。当在一个列表中选择下一个值时,也会在另一个列表中选择下一个值。
这样:
Number: 1, Letter: a
Number: 2, Letter: b
Number: 3, Letter: c
Number: 4, Letter: d
Number: 5, Letter: e
Number: 6, Letter: f
等等。 我该怎么做?
I have two lists.
Numbers = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
Letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
I want to count these two lists in parallel. When the next value is selected in one list, the next value is selected in another list too.
Like this:
Number: 1, Letter: a
Number: 2, Letter: b
Number: 3, Letter: c
Number: 4, Letter: d
Number: 5, Letter: e
Number: 6, Letter: f
and so on.
How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Pythonic Way
Pythonic way
输出:
Outputs: