I have a dictionary of arrays of the following format:
letters = {1: ['h'], 2: ['e'], 3: ['l', 'l'], 4: ['o']}
I'd like to know how I can get all of the values out of the arrays within the letters
dict, bearing in mind that there may be single or multiple values within each one and the array values may be duplicates. So for the above example, I'd want the following output:
letter_values = ['h', 'e', 'l', 'l', 'o']
although the output needn't necessarily be in order.
I know how to get the values out of a dictionary using dict.values()
, but not when there is an additional layer of abstraction like this.