Fill a empty value of a key-value pair with the last value of the previous key.
myitems = {
'items1': [{first:true, second:false}, {first:true, second:true}],
'items2': [], //should be filled with {first:true, second:true}
'items3': [], //should be filled with {first:true, second:true}
'items4': [{first:true, second:false}, {first:true, second:true}],
'items5': [{first:false, second:true}],
'items6': [], //should be filled with {first:false, second:true}
'items7': [{first:true, second:true}],
}
2
Answers
You can do something like this to achieve that.