a = [{1:'1'},{2:'2'},{3:'3'}] b = [i.setdefault('add', 7) for i in a] print(b)
Standard input is empty
[7, 7, 7]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!