I
I
Ivan Betz2021-11-24 21:05:36
Python
Ivan Betz, 2021-11-24 21:05:36

How to make a parallel loop?

a = [1,2,3,4,5]
b = [1,2,3,4,5]
for (i, r) in (a, b):
print(i, r)
ValueError: too many values to unpack (expected 2)

I remember that I saw such an implementation somewhere, but something doesn’t work, what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-11-24
@iwan1997

for i,r in zip(a,b):

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question