Menu

[Solved]Python Implement Function Iscow Lst Parameter List Item List List Containing Two Items Nam Q37022385

IN PYTHON

Implement the function isCow(lst) that has aparameter that is a list where each item in the list is a listcontaining two items: the name of the farm animal and thespecies.

a) prints the name of each animal that is not a “cow” along withthe correct species.

b) at the end, print a list of the names of each cow on oneline.

Make certain to format the output as specified in theexample.

>>> lst = [[‘Daisy’, ‘cow’], [‘Rhaegal’, ‘dragon’],[‘Flicka’, ‘horse’], [‘Pauline Wayne’, ‘cow’], [‘Charlene Mooken’,’cow’], [‘Shaun’, ‘sheep’]]

>>> isCow(lst)

Rhaegal is a dragon.

Flicka is a horse.

Shaun is a sheep.

There are 3 cows on the farm.

The names of the cows are:

Daisy

Pauline Wayne

Charlene Mooken

>>>

Expert Answer


Answer to IN PYTHON Implement the function isCow(lst) that has a parameter that is a list where each item in the list is a list co… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *