Pets: Make several dictionaries, where the name of each dictionary is the name of a pet. In each dictionary, include the kind of animal and the owner’s name. Store these dictionaries in a list called pets. Next, loop through your list and as you do print everything you know about each pet.
Hi i have this question. I have done the solution but i would like to print the dictionaries name without writing print for each
solution:
jumbo = {"kind":"cat",
"owner":"Rahma",
}
snoopy = {"kind":"dog",
"owner":"fahad",
}
shilla = {"kind":"bird",
"owner":"farooq",
}
pets = [jumbo,snoopy,shilla] # created list
#loop through your list and as you do print everything you know about each pet
for pet in pets :
print ( "jumbo" + " is "+ pet["kind"] + " the owner is " + pet["owner"].title() + "." ) )
The problem is i am trying to print the names in each loop using the list pets that was created