Please explain:
>>> [line.rstrip() for line in open('foo')]
[',' 'hello text file6', '', '', '', 'goodby text file7', '', 'bye', '']
>>> with open('foo') as f: [line.rstrip() for line in f if line.rstrip()[-1:].isdigit()]
...
['hello text file6', 'goodby text file7']
[-1:] ignores empty strings while list comprehension above has them.So far I'm accustomed that slices work only within one single string. [-1:] slice seems crossed the boundaries of many strings.