SlideShare a Scribd company logo
(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.

More Related Content

More from NeiltrjGreenez

(rather than herbaceous) in that the sylem often displays secondary gr.pdf
(rather than herbaceous) in that the sylem often displays secondary gr.pdf(rather than herbaceous) in that the sylem often displays secondary gr.pdf
(rather than herbaceous) in that the sylem often displays secondary gr.pdf
NeiltrjGreenez
 
(In java) Create a method to delete a node at a particular position i.pdf
(In java)  Create a method to delete a node at a particular position i.pdf(In java)  Create a method to delete a node at a particular position i.pdf
(In java) Create a method to delete a node at a particular position i.pdf
NeiltrjGreenez
 

More from NeiltrjGreenez (19)

(This task uses Strings-) A program that prompts the user for their pa.pdf
(This task uses Strings-) A program that prompts the user for their pa.pdf(This task uses Strings-) A program that prompts the user for their pa.pdf
(This task uses Strings-) A program that prompts the user for their pa.pdf
 
(rather than herbaceous) in that the sylem often displays secondary gr.pdf
(rather than herbaceous) in that the sylem often displays secondary gr.pdf(rather than herbaceous) in that the sylem often displays secondary gr.pdf
(rather than herbaceous) in that the sylem often displays secondary gr.pdf
 
(Python) A variable defined inside a function is a local variable- oth.pdf
(Python) A variable defined inside a function is a local variable- oth.pdf(Python) A variable defined inside a function is a local variable- oth.pdf
(Python) A variable defined inside a function is a local variable- oth.pdf
 
(Python) Create a function that prints the number of Keys and Values.pdf
(Python)  Create a function that prints the number of Keys and Values.pdf(Python)  Create a function that prints the number of Keys and Values.pdf
(Python) Create a function that prints the number of Keys and Values.pdf
 
(Pskip)-skip.pdf
(Pskip)-skip.pdf(Pskip)-skip.pdf
(Pskip)-skip.pdf
 
(In C++) In a linked list containing student names (string) and their.pdf
(In C++) In a linked list containing student names (string) and their.pdf(In C++) In a linked list containing student names (string) and their.pdf
(In C++) In a linked list containing student names (string) and their.pdf
 
(Multiple answers) Choose all of the following that are considered ris.pdf
(Multiple answers) Choose all of the following that are considered ris.pdf(Multiple answers) Choose all of the following that are considered ris.pdf
(Multiple answers) Choose all of the following that are considered ris.pdf
 
(Multiple answers) Choose all that are risk factors for CVD- HTN famil.pdf
(Multiple answers) Choose all that are risk factors for CVD- HTN famil.pdf(Multiple answers) Choose all that are risk factors for CVD- HTN famil.pdf
(Multiple answers) Choose all that are risk factors for CVD- HTN famil.pdf
 
(ii) There were 500 insects in the total population- In this populatio.pdf
(ii) There were 500 insects in the total population- In this populatio.pdf(ii) There were 500 insects in the total population- In this populatio.pdf
(ii) There were 500 insects in the total population- In this populatio.pdf
 
(i) When the savings rate is 1-3- what is the fiscal multiplier (you c.pdf
(i) When the savings rate is 1-3- what is the fiscal multiplier (you c.pdf(i) When the savings rate is 1-3- what is the fiscal multiplier (you c.pdf
(i) When the savings rate is 1-3- what is the fiscal multiplier (you c.pdf
 
(In java) Create a method to delete a node at a particular position i.pdf
(In java)  Create a method to delete a node at a particular position i.pdf(In java)  Create a method to delete a node at a particular position i.pdf
(In java) Create a method to delete a node at a particular position i.pdf
 
(Exercise 3-- See pages 24+40 of Interpreting earth History (A manual.pdf
(Exercise 3-- See pages 24+40 of Interpreting earth History (A manual.pdf(Exercise 3-- See pages 24+40 of Interpreting earth History (A manual.pdf
(Exercise 3-- See pages 24+40 of Interpreting earth History (A manual.pdf
 
(D) It identifies if the company will be able to pay its current debts.pdf
(D) It identifies if the company will be able to pay its current debts.pdf(D) It identifies if the company will be able to pay its current debts.pdf
(D) It identifies if the company will be able to pay its current debts.pdf
 
(E) cumulative effect of a change in accounting principle- 1 OF 15 QUE.pdf
(E) cumulative effect of a change in accounting principle- 1 OF 15 QUE.pdf(E) cumulative effect of a change in accounting principle- 1 OF 15 QUE.pdf
(E) cumulative effect of a change in accounting principle- 1 OF 15 QUE.pdf
 
(c) Draw a state machine specifying the operations for a Queue using t (1).pdf
(c) Draw a state machine specifying the operations for a Queue using t (1).pdf(c) Draw a state machine specifying the operations for a Queue using t (1).pdf
(c) Draw a state machine specifying the operations for a Queue using t (1).pdf
 
(d) (2 points) Let X1-X2-X3 be independent identicaly distributed N(0-.pdf
(d) (2 points) Let X1-X2-X3 be independent identicaly distributed N(0-.pdf(d) (2 points) Let X1-X2-X3 be independent identicaly distributed N(0-.pdf
(d) (2 points) Let X1-X2-X3 be independent identicaly distributed N(0-.pdf
 
(CC) SLO2 - Business Opportunity Identification Describe how to -ident.pdf
(CC) SLO2 - Business Opportunity Identification Describe how to -ident.pdf(CC) SLO2 - Business Opportunity Identification Describe how to -ident.pdf
(CC) SLO2 - Business Opportunity Identification Describe how to -ident.pdf
 
(a) -10 marks- When the Central Bank purchases Government bonds held b.pdf
(a) -10 marks- When the Central Bank purchases Government bonds held b.pdf(a) -10 marks- When the Central Bank purchases Government bonds held b.pdf
(a) -10 marks- When the Central Bank purchases Government bonds held b.pdf
 
(25 points) Provide an example of a specific piece of spyware- Explain.pdf
(25 points) Provide an example of a specific piece of spyware- Explain.pdf(25 points) Provide an example of a specific piece of spyware- Explain.pdf
(25 points) Provide an example of a specific piece of spyware- Explain.pdf
 

Recently uploaded

Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
Avinash Rai
 

Recently uploaded (20)

Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptx
 
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General QuizPragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. Henry
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resources
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
The Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational ResourcesThe Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational Resources
 

(Python) Create a function that can take in either a list or a diction.pdf

  • 1. (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.