VALLAABAHH
VALLAABAHH

Reputation: 41

Failed to unpack with zip: expected 2, got 1

This my code:

for i, j in zip((roll_number, stu_name)):
   print(i,j)

The error that I get :

Error: not enough values to unpack (expected 2, got 1)

Upvotes: 1

Views: 84

Answers (1)

RoseGod
RoseGod

Reputation: 1234

you have redundant () in the:

zip((roll_number, stu_name))

change to:

zip(roll_number, stu_name)

Here is the code:

for i, j in zip(roll_number, stu_name):
    print(i,j)

Upvotes: 2

Related Questions