0
sub = {} 
for a, b in sub:                   #<--- error occurs here
   for s in b:
       #do blah. I was told a b is a list

and it gives me TypeError: unpack non-sequence

What is this mean?

ealeon
  • 12,074
  • 24
  • 92
  • 173

1 Answers1

4

Are you looking for this?

for a, b in sub.iteritems():
    # Do Something.

Doing

for a, b in sub:
    #...

tries to assign (a, b) to a key in sub which may not be a sequence.

Sukrit Kalra
  • 33,167
  • 7
  • 69
  • 71