python - ValueError: too many values to unpack for sorted dictionary -
i got exception "valueerror: many values unpack", problem next codes?
for key, item in sorted(resdic): outfiles.write('%s %s\n' % (key, item))
sorted(resdic)
returns keys. homecoming both keys , values, write sorted(resdic.items())
:
for key, item in sorted(resdic.items()): outfiles.write('%s %s\n' % (key, item))
python
No comments:
Post a Comment