dictionaryのkeyを取得する
dictionaryのキーを取得するにはiteritems() を使用する
>>> dict = {"apple":2, "banana":3} >>> (apple,banana) =dict.iteritems() >>> apple ('apple', 2) >>> banana ('banana', 3)
PHPのforeachのような使い方
>>> for key, value in dict.iteritems(): ... print key, value ... apple 2 banana 3