Question: (Python) Create a function that can take in either a list or a dictionary as its first parameter, and a searchTerm as its second parameter.

(Python)

Create a function that can take in either a list or a dictionary as its first parameter, and a searchTerm as its second parameter. If the searchTerm is found inside of a list, print out the index of the searchTerm If the searchTerm is found inside of a dictionary, print the result. If the searchTerm is not found print a message indicating so. You are only searching for the searchTerm on the first level of a dictionary/list.

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!