for-loop with index in dictionary === ```python= fruits = {"apple":"red", "banana":"yellow"} for i, key in enumerate(fruits): print (i, key) ``` output ``` 0 apple 1 banana ``` ## Ref [Python Iterate Dictionary by Index]([https://](https://stackoverflow.com/questions/17793364/python-iterate-dictionary-by-index)) ###### tags: `語法相關`