How do I print the key-value pairs of a dictionary in python
Python 2 and Python 3 i is the key, so you would just need to use it: Python 3 d.items() returns the iterator; to get a list, you need to pass the iterator to list() yourself. Python 2 You can get an iterator that contains both keys and values. d.items() returns a list of (key, … Read more