pairs = {("Ana", "Berta"), ("Ana", "Greta"), ("Ana", "Helga"),.

Added on - Sep 2019

Trusted by 2+ million users,
1000+ happy students everyday
Showing pages 1 to 1 of 2 pages
pairs = {("Ana", "Berta"), ("Ana", "Greta"), ("Ana", "Helga"),("Berta", "Cilka"), ("Berta", "Helga"),("Cilka", "Dani"),("Dani", "Ema"), ("Dani", "Greta"), ("Dani", "Helga"),("Ema", "Fanči"), ("Ema", "Greta"), ("Ema", "Helga"),("Fanči", "Iva"), ("Fanči", "Jana"), ("Fanči", "Klavdija"),("Greta", "Helga")}For simplicity and efficiency, every pair is listed just once, in alphabetic order (e.g. ("Ana","Berta") and not also ("Berta", "Ana").The other representation is a dictionary, where keys contain names and the correspondingvalues are sets of = {"Ana": {"Berta", "Greta", "Helga"},"Berta": {"Ana", "Helga", "Cilka"},"Cilka": {"Berta", "Dani"},"Dani": {"Cilka", "Ema", "Greta", "Helga"},"Ema": {"Dani", "Fanči", "Greta", "Helga"},"Fanči": {"Ema", "Iva", "Jana", "Klavdija"},"Greta": {"Ana", "Dani", "Ema", "Helga"},"Helga": {"Ana", "Berta", "Dani", "Ema", "Greta"},"Iva": {"Fanči"},"Jana": {"Fanči"},"Klavdija": {"Fanči"}}
Desklib Logo
You are reading a preview
Upload your documents to download or

Become a Desklib member to get access