Tag Archives: dict()

Python: How to convert a dictionary into a list of key-value

Using the list() function, we can convert a dictionary into a list of key-value tuple. Continue reading

Posted in Python | Tagged , , , | Leave a comment

How to sort Python dictionary

Sorting a Python dictionary. Continue reading

Posted in Python | Tagged , , , , | 2 Comments

How to convert two Python lists into a dictionary

To convert two Python lists into a dictionary. First, pair the two list with the zip() function, as key-value pairs. The last step is to use the dict() constructor to build a dictionary directly from the key-value pairs. Continue reading

Posted in Python | Tagged , , , , | Leave a comment