I have list of dict in python like this
list_qty = [{'id':1,'qty': '10'},{'id':1,'qty': '15'},{'id':2,'qty': '7'},{'id':2,'qty': '20'},{'id':2,'qty': '30'}]
i want to get last index
of dict from list_qty
that have same id
output that i want is:
list_qty2 = [{'id':1,'qty': '15'},{'id':2,'qty': '30'}]
anyone can help me with this?