dict.values()
to return the values in the given dictionary.list()
of the previous result.def values_only(flat_dict): return list(flat_dict.values())
ages = { 'Peter': 10, 'Isabel': 11, 'Anna': 9, } values_only(ages) # [10, 11, 9]
Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️