I have a list that looks like this -
item1,5,1,648,16,10,0,3,5,1,1,0,1,1,1,0,0,0,0,0,1,0,0,1,0,0
item2,3,1,29,3,6,0,0,3,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0
item3,4,1,2388,20,8,2,0,3,1,1,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0
item4,6,3,0,0,1,0,0,5,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,1,0
What would be the best way of deleting the "item" part of the list?
I've tried
del list[j][0]
But then I get "TypeError: 'str' object doesn't support item deletion"
I've tried
list[j].remove(list[j][0])
But then I get AttributeError: 'str' object has no attribute 'remove'
Pop doesn't seem to work either - AttributeError: 'str' object has no attribute 'pop'
Any ideas?
EDIT: So I've read in a list -
data = open("flags.features", 'r').readlines()
Then just split each line -
for i in data:
input_list.append(i.split('\n')[0])
With an output of -
['item1,5,1,648,16,10,0,3,5,1,1,0,1,1,1,0,0,0,0,0,1,0,0,1,0,0', 'item2,3,1,29,3,6,0,0,3,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0', 'item3,4,1,2388,20,8,2,0,3,1,1,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0', 'item4,6,3,0,0,1,0,0,5,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,1,0', 'item5,3,1,0,0,6,3,0,3,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0', '