2
for x,y in (range(3),range(3)):
    print(x+','+y)

I wont a simple output of any pare of numbers something like that:

1,1
2,2
3,3

I get:

Traceback (most recent call last):
  File "<pyshell#36>", line 1, in <module>
    for x,y in (range(3),range(3)):
ValueError: too many values to unpack (expected 2)
user1942505
  • 480
  • 5
  • 11
  • 20

1 Answers1

3

you can use the built-in method zip:

for x,y in zip(range(3),range(3)):
    print(x, y, sep=',')
kederrac
  • 16,819
  • 6
  • 32
  • 55