Python – Convert a Dictionary to a List

We can easily create a Python list by pulling only the values out of a dictionary. This is done via the values() method.

>>> x = {‘a’:1, ‘b’:2}
>>> x
{‘a’: 1, ‘b’: 2}
>>> y = list(x.values())
>>> y
[(1), (2)…

More