Skip to content

Instantly share code, notes, and snippets.

@ChaitanyaBaweja
Created July 31, 2022 08:03
Show Gist options
  • Save ChaitanyaBaweja/8b29f278c4305f096d6d014694e310da to your computer and use it in GitHub Desktop.
Save ChaitanyaBaweja/8b29f278c4305f096d6d014694e310da to your computer and use it in GitHub Desktop.
temp data
temp = {"123":{"H":1,"B":2},
"456":{"H":1, "B":1}
}
data = {"event": [
{ "id":"123",
"H":[{"name":3,
"label":2}
],
"B": [{"name":3,
"label":2},
{"name":3,
"label":2}
]
}
]
}
for key in temp.keys():
for j in range(len( data['event'])):
if key == data['event'][j]['id']:
if temp[key]["H"] == len(data['event'][j]["H"]):
print("correct")
else:
print("not correct")
if temp[key]["B"] == len(data['event'][j]["B"]):
print("correct")
else:
print("not correct")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment