經安全檢測,此網站為安全網站,請放心前往原始網址!

dictionary - Iterating over Dictionaries...For Loops in Python - Stack Overflow

key is just a variable name. for key in d: will simply loop over the keys in the dictionary, rather than the keys and values. To loop over both key and value you can use for key, value in d.iteritems(): Test for yourself, change the word key to poop EDIT

stackoverflow.com

網址安全性掃描由 google 提供