Hello team, I have this python snippet whereby it contains 4 for loops which contain a dict and the output is repetitive kindly requesting for help for it to output only unique data. below is the snippet i will really appreciate your help. Thanks in Advance
for A_R_Tokens in Request_Token_List:
for A_Account_No in V_Account_Payment_Phone_list[0]:
for A_Payer_ID in V_PayerID_ProductID_list[0]:
for A_Product_ID in V_PayerID_ProductID_list[1]:
data = {
'__RequestVerificationToken': A_R_Tokens,
'PayerId-input': A_Account_No,
'PayerId': A_Payer_ID,
'ProductId': A_Product_ID,
'QueueItemId': '',
'Comment': ''
}
On running it i get repetitive output
and on running the code this what i get
{'__RequestVerificationToken': 'se', 'PayerId-input': '31955948', 'PayerId': '1c17da55-a8bb-ea11-a9a9-', 'ProductId': '1e17da55-a8bb-ea11-a9a9-000d3a298bc6', 'QueueItemId': '', 'Comment': ''}
{'__RequestVerificationToken': 'se', 'PayerId-input': '31955948', 'PayerId': '1c17da55-a8bb-ea11-a9a9-', 'ProductId': 'dc0525fd-3bbe-e711-a952-000d3a26b1fe', 'QueueItemId': '', 'Comment': ''}
{'__RequestVerificationToken': 'se', 'PayerId-input': '31955948', 'PayerId': 'da0525fd-3bbe-e711-a952-000d3a26b1fe', 'ProductId': '1e17da55-a8bb-ea11-a9a9-000d3a298bc6', 'QueueItemId': '', 'Comment': ''}
and the output that i want is
{'__RequestVerificationToken': 'se', 'PayerId-input': '31955948', 'PayerId': '1c17da55-a8bb-ea11-a9a9-', 'ProductId': '1e17da55-a8bb-ea11-a9a9-000d3a298bc6', 'QueueItemId': '', 'Comment': ''}
I will really appreciate any help coming through
What I have tried:
I Have tried sets which didn't work because dictionaries can not be hash-able