I have a list of scores
, e.g. [60, 60, 60, 30, 60, 57, 57, 57]
, and a lookup dict all_scores_to_numerical_scores
. The scores
represent point values for an individual dart in a game of darts, and the lookup indicates ways to get that score.
When I use
[all_scores_to_numerical_scores[score] for score in scores]
I get a result like
[['T20'], ['T20'], ['T20'], ['D15', 'T10'], ['T20'], ['T19'], ['T19'], ['T19']]
That is, each nested list shows values corresponding to one of the original scores
. I want to get a result like this instead:
[['T20'], ['T20'], ['T20'], ['D15'], ['T20'], ['T19'], ['T19'], ['T19']]
[['T20'], ['T20'], ['T20'], ['T10'], ['T20'], ['T19'], ['T19'], ['T19']]
That is, multiple lists, each of which shows a single way to obtain all of the scores.
How can I do this?