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
  • 432
  • 5
  • 11
  • 19

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
  • 15,932
  • 5
  • 29
  • 52