Question: python Write a function called dog owners that takes as a parameter a list of tuples (each containing a name and a type of pet

python

python Write a function called dog owners that takes as a parameter

Write a function called dog owners that takes as a parameter a list of tuples (each containing a name and a type of pet ("dog", "cat" or "rabbit")) and returns a list of the names of the people who have dogs as pets. example function call: tuplist = [("Patrick","dog"),("Squidward","dog"),("Sandy","rabbit")] print(dog_owners(tuplist)) would print out this list ["Patrick", "Squidward"]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!