I'm trying to del an object in my list inside my loop but it's not working.
data = []
data.append({
'one': 1,
'two': 2
})
data.append({
'one': 3,
'two': 4
})
data.append({
'one': 5,
'two': 6
})
for d in data:
if d['one'] == 3:
del d
It's impossible to delete my object like that ? del d
The only one solution that I found is to create a counter then delete with index in the data list del data[x]