I have a list of dictionaries and would like to update the value for key \'price\' with 0 if key price value is equal to \'\'
data=[a[\'price\']=0 for a in
if you're using dict.update don't assign it to the original variable since it returns None
[a.update(price=0) for a in data if a['price']=='']
without assignment will update the list...