I have a CSV file that contains book chapters either as single chapters or chapter ranges delimited by commas, e.g. `1,2,4-6,12`.

Given this input `'1,2,4-6,12'`, I want a list `['1','2','4','5','6','12']` as output

Something along the lines of:

```py
chps=[str(x) for x in chp_range(entry)) if '-' in entry else entry  for entry in chapters.split(',') ]

```

which doesn't work.

Function `chp_range('4-6')` returns a `range(4,6)` object.

I've tried a lot of variations, but still haven't been able to get the order of conditionals and iteration right. How can I get this code to work?