Hello, I need to compare 2 values of 2 arrays, but I'm not if getting:
plan = [{'Cod': '11518', 'qtdPallet': '176', 'qtdLastro': '22', 'qtdCx': '12', 'Prod': 'Exemplo1', 'FC': '1'}, {'Cod': '972', 'qtdPallet': '72', 'qtdLastro': '9', 'qtdCx': '24', 'Prod': 'Exemplo2', 'FC': '2'}]
dados = [{'qtdCx': '133', 'qtdUn': '00', 'Cod': '11518'}, {'qtdCx': '345', 'qtdUn': '5', 'Cod': '13'}, {'qtdCx': '234', 'qtdUn': '03', 'Cod': '13205'}, {'qtdCx': '3545', 'qtdUn': '09', 'Cod': '16'}, {'qtdCx': '1884', 'qtdUn': '03', 'Cod': '978'}]
def calcula():
for plax in plan:
for dad in dados:
if dad['Cod'] == plax['Cod']:
print(plax["Prod"])
calcula()
I compare the codes of each and if they are the same I will use them; but it's not working. What am I doing wrong? I've had this problem for a long time and I can not solve it in any way!