Question: Please help 1) Complete the function favoriteFlower(). Note that the program will not run as is because the function is incomplete. The purpose of the

Please help

1)

Please help 1) Complete the function favoriteFlower(). Note that the program will

Complete the function favoriteFlower(). Note that the program will not run as is because the function is incomplete. The purpose of the function is to determine if the given flower is in the top three of my favorite flowers. The starter file defines a list of favorite flowers that is ordered most favorite to least favorite. Please pass the flower name and the flower list as arguments in the function. The expected output is:

Is lily one of my favorite flowers? True Is orchids one of my favorite flowers? False Is rose one of my favorite flowers? False

2)

not run as is because the function is incomplete. The purpose of

omplete the function missingNum(). Note that the program will not run as is because the function is incomplete. The purpose of the function is to replace all instances of zero in the list with the word "missing". The function should take the list and return the list once it has been changed. Changing the list may require a for loop and if statements. You may even need to iterate by index INSTEAD of by value! Just sayin'....

All the nums: [4, 7, 0, 10, 32, 0, 51, 0, 89, 100] Replaced nums: [4, 7, 'missing', 10, 32, 'missing', 51, 'missing', 89, 100]

\#define list of flowers myFlowers = ['daffodil', 'lavendar', 'lily', 'daisy', 'rose', 'hydrangea', 'dahlia', 'sunflower'] \#Function that determines if given flower is one of the top three favorites def favoriteFlower ( ): \#check if given flower is in the top three, return True (boolean) if is return print("Is lily one of my favorite flowers? ", favoriteflower("lily",myFlowers)) print("Is orchids one of my favorite flowers? ", favoriteFlower ("orchids", myFlowers)) print("Is rose one of my favorite flowers?", favoriteflower("rose",myFlowers)) \#define list of nums allNums =[4,7,0,10,32,0,51,0,89,100] \#def function that replaces zeros with 'missing' def missingnum(): \#replace all zeros with 'missing' return print("All the nums: ", allNums) updatedList = missingnum(allNums) print("Replaced nums: ", updatedList)

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!