sub = {}
for a, b in sub: #<--- error occurs here
for s in b:
#do blah. I was told a b is a list
它给了我TypeError: unpack non-sequence
这是什么意思?
答案 0 :(得分:4)
你在找这个吗?
for a, b in sub.iteritems():
# Do Something.
否则
for a, b in sub:
#...
尝试将(a, b)
分配给sub
中可能不是序列的密钥。