Skip to content
Snippets Groups Projects
Commit f7626684 authored by Ismail Moumni's avatar Ismail Moumni
Browse files

Editing Function match_dict

parent 793249b6
No related branches found
No related tags found
1 merge request!5Wip adding tests and json functions
......@@ -47,11 +47,10 @@ def run_client(Host, Port, message: str):
def match_dict(biblio: dict, gen: dict):
missing = []
if (len(biblio) != 0):
for a in biblio:
for b in gen:
if a != b:
missing.append(b)
return missing
for key in biblio:
if key not in gen:
missing.append(key)
return missing
else:
raise TypeError("Dictionnaire Vide!!")
......@@ -134,5 +133,5 @@ def help():
if __name__ == '__main__':
print(match_dict({"ismail"}, {"ismail"}))
print(match_dict({"lala": "MomO"}, ["toto", "tata"]))
help()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment