Q:

Remove blank string value from a list of strings

I am reading string information as input from a text file and placing them into lists, and one of the lines is like this:
30121,long,Mehtab,10,20,,30

I want to remove the empty value in between the ,, portion from this list, but have had zero results.  I've tried .remove() and filter().  Python reads it as a 'str' value. 

A:

Use split() and remove()
In [11]: s = '30121,long,Mehtab,10,20,,30'

In [14]: l = s.split(',')

In [15]: l.remove('')

In [16]: l
Out[16]: ['30121', 'long', 'Mehtab', '10', '20', '30']

