Here is my code :
list1 = [{'price': '21213.50', 'symbol': 'BTCUSD', 'id': 212135000, 'side': 'Sell', 'size': 24218}]
list2 = [{'price': '21213.50', 'symbol': 'BTCUSD', 'id': 212135000, 'side': 'Sell', 'size': 12788}]
list3 = [{'price': '21213.50', 'symbol': 'BTCUSD', 'id': 212135000, 'side': 'Sell', 'size': 7358}]
list4 =[{'price': '21221.50', 'symbol': 'BTCUSD', 'id': 212215000, 'side': 'Sell', 'size': 16817}, {'price': '21213.50', 'symbol': 'BTCUSD', 'id': 212220000, 'side': 'Sell', 'size': 60657}]
As you can see I have 4 list or more it doesn't matter. First I defined a function to convert these list into dicts.
def list_to_dict(a):
for i in range(len(a)):
print(a[i])
when I call this function like :
list_to_dict(list1)
list_to_dict(list2)
list_to_dict(list3)
list_to_dict(list4)
I get these results :
{'price': '21213.50', 'symbol': 'BTCUSD', 'id': 212135000, 'side': 'Sell', 'size': 24218}
{'price': '21213.50', 'symbol': 'BTCUSD', 'id': 212135000, 'side': 'Sell', 'size': 12788}
{'price': '21213.50', 'symbol': 'BTCUSD', 'id': 212135000, 'side': 'Sell', 'size': 7358}
{'price': '21221.50', 'symbol': 'BTCUSD', 'id': 212215000, 'side': 'Sell', 'size': 16817}
{'price': '21213.50', 'symbol': 'BTCUSD', 'id': 212220000, 'side': 'Sell', 'size': 60657}
after that I want to compare these dicts, I am trying to achieve these result( both dictionaries price and side are equal but size is different) by different I want how different ? for ex. size increased by 10000 as integer. Target output = a tuple maybe for ex. (21213.5,sell) increased by 10000.