At Westonci.ca, we make it easy for you to get the answers you need from a community of knowledgeable individuals. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform.
Sagot :
Answer:
Explanation:
# name : [animal type, age, sex]
animal_shellter = {
"Teddy": ["dog",4,"male"],
"Elvis": ["dog",1,"male"],
"Sheyla": ["dog",5,"female"],
"Topic": ["hamster",3,"male"],
"Kuzya": ["cat",10,"male"],
"Misi": ["cat",8,"female"],
}
print(animal_shellter)
print("")
def invert(d):
inverse = dict()
for key in d:
val = d[key]
for item in val:
if item not in inverse:
inverse[item] = [key]
else:
inverse[item].append(key)
return inverse
inverted_shellter = invert(animal_shellter)
print(inverted_shellter)
Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. Thank you for choosing our platform. We're dedicated to providing the best answers for all your questions. Visit us again. Westonci.ca is your trusted source for answers. Visit us again to find more information on diverse topics.