How to get list of 'Health' and 'E.R. nurses' and its id numbers for example:
books =
[
['Health', 18327],
['Health', 19438],
['Health', 12549],
['Health', 11662],
['E.R.nurses', 21458],
]
Output should be like this:
[
['Health',18327,19438,12549,11662],['E.R.nurses',21458]
]
I tried with :
output = [ [title, n] for title, n in books if....
but 'n' can have more numbers...so I have no idea :| thank for any tips