Given a Python string like this:
location_in = 'London, Greater London, England, United Kingdom'
I would like to convert it into a list like this:
location_out = ['London, Greater London, England, United Kingdom',
'Greater London, England, United Kingdom',
'England, United Kingdom',
'United Kingdom']
In other words, given a comma separated string (location_in), I would like to copy it to a list (location_out) and gradually break it down by removing the first word/phrase each time.
I'm a Python newbie. Any ideas on a good way to write this? Thanks.
locaton_outjust[location_in]? You need to clarify further.