I'm trying to write a function that consumes a list of keycode values, and produces a string corresponding to these values. Each keycode contains 2 values, the first corresponding to a number of a phone and the second corresponding to a certain value from the list of values that define each number. I'm having trouble extracting these values. This is the list of values that correspond with each number:
0 == [" "]
1 == [".", ",", "?"]
2 == ["a", "b", "c"]
3 == ["d", "e", "f"]
4 == ["g", "h", "i"]
5 == ["j", "k", "l"]
6 == ["m", "n", "o"]
7 == ["p", "q", "r", "s"]
8 == ["t", "u", "v"]
9 == ["w", "x", "y", "z"]`
If the list of keyed values that I'm consuming is keypresses: [[6,3], [0, 1], [5, 2]] How can I extract certain values from the definitions above? I'm thinking about using .join(list) and map for once I have the values extracted.
[[' '], ['.',',','?'], ...]or{'0': [' '], ...}. b/ access that data using the input you have :''.join(values[key][cnt - 1] for (key, cnt) in keypresses)