I have Python 3.12 on Windows 10.
If I have list1 and list2, I would like a quick way to append non-blank items in list1 into list2. Example.
Below is how I do it now. Is there a list comprehension that might do this?
list1 = ['one', '', 'two', '', 'three']
list2 = ['new']
for l in list1:
if l:
list2.append(l)
# list2 will be: ['new', 'one', 'two', 'three']
Thank you.