私は辞書「mydict」を持っています。
{ 'a': ['xyz1', 'xyz2'],
'b': ['xyz3', 'xyz4'],
'c': ['xyz5'],
'd': ['xyz6']}
次のコードを使用して、この辞書のすべてのキーと値を出力しようとしています。
for username, details in mydict.iteritems():
pprint.pprint(username + " " + details)
しかし、次のエラーが発生します。
AttributeError: 'list' object has no attribute 'iteritems'
どんな助けでも大歓迎です。