Skip to content

How to retrieve dictionary values in Python by index?

a_dictionary = {"a": 1, "b": 2, "c":3}
keys_list = list(a_dictionary)
key = keys_list[0]
print(key)
See also  Python code snippet - How to convert adjacency matrix to adjacency list?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.