fork download
  1. a = [{1:'1'},{2:'2'},{3:'3'}]
  2.  
  3. b = [i.setdefault('add', 7) for i in a]
  4.  
  5. print(b)
Success #stdin #stdout 0.02s 9060KB
stdin
Standard input is empty
stdout
[7, 7, 7]