I've looked at other answers but it looks like they use 2 different values.
The code:
user = ['X', 'Y', 'Z'] info = [['a','b','c',], ['d','e','f'], ['g','h','i']] for u, g in user, range(len(user)): print '|',u,'|',info[g][0],'|',info[g][1],'|',info[g][2],'| \n' So basically, it needs to output:
'| X | a | b | c |' '| Y | d | e | f |' '| z | g | h | i |' But instead, I get this error:
Traceback (most recent call last): File "<pyshell#19>", line 1, in <module> for u, g in user, range(len(user)): ValueError: too many values to unpack As far as I know both user and range(len(user)) are of equal value.
for g,u in enumerate(user):. But, as others have said, in this case you don't want indexes, you wantzip.