SlideShare a Scribd company logo
1 of 1
Download to read offline
Please help
1) Use any data structures or control flows as appropriate to complete the following prompt where
you manipulate 2D LISTS.
The chart above list courses and instructors who teach them.
This course chart is stored in a 2-dimensional list. The "outer" list is the instructors (rows) and the
"inner" list is the various courses the given instructor teaches (columns).
course1 = "INST126"
course2 = "INST314"
courseChart = [['INST126', 'INST327', 'INST123'],
['INST327', 'INST123', 'INST314'],
['INST126'],
['INST314'],
['INST314', 'INST414'],
['INST327']]
instructorNames = ['Duffy', 'Diker', 'Lindeman', 'Kacorri', 'Momeni','Nelson']
def whoTeaches():
return
print("The course ",course1," is taught by ",whoTeaches(course1, courseChart))
print("The course ",course2," is taught by ",whoTeaches(course2, courseChart))
Complete the function whoTeaches(). Note that the program will not run as is because the function
is incomplete. The purpose of the function is to determine the instructors that teach a given
course. The function takes the chosen course and the course chart. The function then returns
a list instructors who teach that course. Note that the function should work for ANY 2D list of
instructors and courses and ANY chosen course (aka a dynamic function!).
The expected output is:
You may find yourself using nested loops and conditionals, and appending to lists!
Course Chart

More Related Content

More from kitty811

Please give me a new topic not the one already on cheggQU.pdf
Please give me a new topic not the one already on cheggQU.pdfPlease give me a new topic not the one already on cheggQU.pdf
Please give me a new topic not the one already on cheggQU.pdfkitty811
 
please give ANY inswer in 30 min The CONTROL pyloric rhythm .pdf
please give ANY inswer in 30 min The CONTROL pyloric rhythm .pdfplease give ANY inswer in 30 min The CONTROL pyloric rhythm .pdf
please give ANY inswer in 30 min The CONTROL pyloric rhythm .pdfkitty811
 
please full it please full it 2 Genie and Dan have just ha.pdf
please full it please full it 2 Genie and Dan have just ha.pdfplease full it please full it 2 Genie and Dan have just ha.pdf
please full it please full it 2 Genie and Dan have just ha.pdfkitty811
 
Please find the Below YAML code whihc is meant to achieve th.pdf
Please find the Below YAML code whihc is meant to achieve th.pdfPlease find the Below YAML code whihc is meant to achieve th.pdf
Please find the Below YAML code whihc is meant to achieve th.pdfkitty811
 
Please fix my errors class Iterator public Construc.pdf
Please fix my errors   class Iterator  public  Construc.pdfPlease fix my errors   class Iterator  public  Construc.pdf
Please fix my errors class Iterator public Construc.pdfkitty811
 
Please fill in the blanks of the 5 questions Required inform.pdf
Please fill in the blanks of the 5 questions Required inform.pdfPlease fill in the blanks of the 5 questions Required inform.pdf
Please fill in the blanks of the 5 questions Required inform.pdfkitty811
 
please fast answer Suppose that XU nif 01 You draw a sa.pdf
please fast answer  Suppose that XU nif 01 You draw a sa.pdfplease fast answer  Suppose that XU nif 01 You draw a sa.pdf
please fast answer Suppose that XU nif 01 You draw a sa.pdfkitty811
 
Please explain in steps so I may be able to follow and learn.pdf
Please explain in steps so I may be able to follow and learn.pdfPlease explain in steps so I may be able to follow and learn.pdf
Please explain in steps so I may be able to follow and learn.pdfkitty811
 
Please explain why c is correct Why does this return and e.pdf
Please explain why c is correct  Why does this return and e.pdfPlease explain why c is correct  Why does this return and e.pdf
Please explain why c is correct Why does this return and e.pdfkitty811
 
Please code in C in Visual Studio Thank you 1 Create a C.pdf
Please code in C in Visual Studio Thank you 1 Create a C.pdfPlease code in C in Visual Studio Thank you 1 Create a C.pdf
Please code in C in Visual Studio Thank you 1 Create a C.pdfkitty811
 
Please explain step by step Current Attempt in Progress As .pdf
Please explain step by step Current Attempt in Progress As .pdfPlease explain step by step Current Attempt in Progress As .pdf
Please explain step by step Current Attempt in Progress As .pdfkitty811
 
Please explain how to find the answer Thank you You may ne.pdf
Please explain how to find the answer Thank you You may ne.pdfPlease explain how to find the answer Thank you You may ne.pdf
Please explain how to find the answer Thank you You may ne.pdfkitty811
 
please explain If fn and gn are both Ohn then f.pdf
please explain   If fn and gn are both Ohn then f.pdfplease explain   If fn and gn are both Ohn then f.pdf
please explain If fn and gn are both Ohn then f.pdfkitty811
 
Please explain and expound in your own words What the topic.pdf
Please explain and expound in your own words What the topic.pdfPlease explain and expound in your own words What the topic.pdf
Please explain and expound in your own words What the topic.pdfkitty811
 
Please draw the moons with the proper labeling When answeri.pdf
Please draw the moons with the proper labeling When answeri.pdfPlease draw the moons with the proper labeling When answeri.pdf
Please draw the moons with the proper labeling When answeri.pdfkitty811
 
Please code the following in C v Write decision making l.pdf
Please code the following in C v Write decision making l.pdfPlease code the following in C v Write decision making l.pdf
Please code the following in C v Write decision making l.pdfkitty811
 
Please correct my code for me i am lost Thanks i submitted.pdf
Please correct my code for me i am lost Thanks i submitted.pdfPlease correct my code for me i am lost Thanks i submitted.pdf
Please correct my code for me i am lost Thanks i submitted.pdfkitty811
 
Please code in C in Visual Studio Create a Customermdf da.pdf
Please code in C in Visual Studio Create a Customermdf da.pdfPlease code in C in Visual Studio Create a Customermdf da.pdf
Please code in C in Visual Studio Create a Customermdf da.pdfkitty811
 
Please discussinclude the following in a minimum of 150200.pdf
Please discussinclude the following in a minimum of 150200.pdfPlease discussinclude the following in a minimum of 150200.pdf
Please discussinclude the following in a minimum of 150200.pdfkitty811
 
please do use case Customers description of desired softwa.pdf
please do use case  Customers description of desired softwa.pdfplease do use case  Customers description of desired softwa.pdf
please do use case Customers description of desired softwa.pdfkitty811
 

More from kitty811 (20)

Please give me a new topic not the one already on cheggQU.pdf
Please give me a new topic not the one already on cheggQU.pdfPlease give me a new topic not the one already on cheggQU.pdf
Please give me a new topic not the one already on cheggQU.pdf
 
please give ANY inswer in 30 min The CONTROL pyloric rhythm .pdf
please give ANY inswer in 30 min The CONTROL pyloric rhythm .pdfplease give ANY inswer in 30 min The CONTROL pyloric rhythm .pdf
please give ANY inswer in 30 min The CONTROL pyloric rhythm .pdf
 
please full it please full it 2 Genie and Dan have just ha.pdf
please full it please full it 2 Genie and Dan have just ha.pdfplease full it please full it 2 Genie and Dan have just ha.pdf
please full it please full it 2 Genie and Dan have just ha.pdf
 
Please find the Below YAML code whihc is meant to achieve th.pdf
Please find the Below YAML code whihc is meant to achieve th.pdfPlease find the Below YAML code whihc is meant to achieve th.pdf
Please find the Below YAML code whihc is meant to achieve th.pdf
 
Please fix my errors class Iterator public Construc.pdf
Please fix my errors   class Iterator  public  Construc.pdfPlease fix my errors   class Iterator  public  Construc.pdf
Please fix my errors class Iterator public Construc.pdf
 
Please fill in the blanks of the 5 questions Required inform.pdf
Please fill in the blanks of the 5 questions Required inform.pdfPlease fill in the blanks of the 5 questions Required inform.pdf
Please fill in the blanks of the 5 questions Required inform.pdf
 
please fast answer Suppose that XU nif 01 You draw a sa.pdf
please fast answer  Suppose that XU nif 01 You draw a sa.pdfplease fast answer  Suppose that XU nif 01 You draw a sa.pdf
please fast answer Suppose that XU nif 01 You draw a sa.pdf
 
Please explain in steps so I may be able to follow and learn.pdf
Please explain in steps so I may be able to follow and learn.pdfPlease explain in steps so I may be able to follow and learn.pdf
Please explain in steps so I may be able to follow and learn.pdf
 
Please explain why c is correct Why does this return and e.pdf
Please explain why c is correct  Why does this return and e.pdfPlease explain why c is correct  Why does this return and e.pdf
Please explain why c is correct Why does this return and e.pdf
 
Please code in C in Visual Studio Thank you 1 Create a C.pdf
Please code in C in Visual Studio Thank you 1 Create a C.pdfPlease code in C in Visual Studio Thank you 1 Create a C.pdf
Please code in C in Visual Studio Thank you 1 Create a C.pdf
 
Please explain step by step Current Attempt in Progress As .pdf
Please explain step by step Current Attempt in Progress As .pdfPlease explain step by step Current Attempt in Progress As .pdf
Please explain step by step Current Attempt in Progress As .pdf
 
Please explain how to find the answer Thank you You may ne.pdf
Please explain how to find the answer Thank you You may ne.pdfPlease explain how to find the answer Thank you You may ne.pdf
Please explain how to find the answer Thank you You may ne.pdf
 
please explain If fn and gn are both Ohn then f.pdf
please explain   If fn and gn are both Ohn then f.pdfplease explain   If fn and gn are both Ohn then f.pdf
please explain If fn and gn are both Ohn then f.pdf
 
Please explain and expound in your own words What the topic.pdf
Please explain and expound in your own words What the topic.pdfPlease explain and expound in your own words What the topic.pdf
Please explain and expound in your own words What the topic.pdf
 
Please draw the moons with the proper labeling When answeri.pdf
Please draw the moons with the proper labeling When answeri.pdfPlease draw the moons with the proper labeling When answeri.pdf
Please draw the moons with the proper labeling When answeri.pdf
 
Please code the following in C v Write decision making l.pdf
Please code the following in C v Write decision making l.pdfPlease code the following in C v Write decision making l.pdf
Please code the following in C v Write decision making l.pdf
 
Please correct my code for me i am lost Thanks i submitted.pdf
Please correct my code for me i am lost Thanks i submitted.pdfPlease correct my code for me i am lost Thanks i submitted.pdf
Please correct my code for me i am lost Thanks i submitted.pdf
 
Please code in C in Visual Studio Create a Customermdf da.pdf
Please code in C in Visual Studio Create a Customermdf da.pdfPlease code in C in Visual Studio Create a Customermdf da.pdf
Please code in C in Visual Studio Create a Customermdf da.pdf
 
Please discussinclude the following in a minimum of 150200.pdf
Please discussinclude the following in a minimum of 150200.pdfPlease discussinclude the following in a minimum of 150200.pdf
Please discussinclude the following in a minimum of 150200.pdf
 
please do use case Customers description of desired softwa.pdf
please do use case  Customers description of desired softwa.pdfplease do use case  Customers description of desired softwa.pdf
please do use case Customers description of desired softwa.pdf
 

Recently uploaded

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 

Recently uploaded (20)

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 

Please help 1 Use any data structures or control flows as a.pdf

  • 1. Please help 1) Use any data structures or control flows as appropriate to complete the following prompt where you manipulate 2D LISTS. The chart above list courses and instructors who teach them. This course chart is stored in a 2-dimensional list. The "outer" list is the instructors (rows) and the "inner" list is the various courses the given instructor teaches (columns). course1 = "INST126" course2 = "INST314" courseChart = [['INST126', 'INST327', 'INST123'], ['INST327', 'INST123', 'INST314'], ['INST126'], ['INST314'], ['INST314', 'INST414'], ['INST327']] instructorNames = ['Duffy', 'Diker', 'Lindeman', 'Kacorri', 'Momeni','Nelson'] def whoTeaches(): return print("The course ",course1," is taught by ",whoTeaches(course1, courseChart)) print("The course ",course2," is taught by ",whoTeaches(course2, courseChart)) Complete the function whoTeaches(). Note that the program will not run as is because the function is incomplete. The purpose of the function is to determine the instructors that teach a given course. The function takes the chosen course and the course chart. The function then returns a list instructors who teach that course. Note that the function should work for ANY 2D list of instructors and courses and ANY chosen course (aka a dynamic function!). The expected output is: You may find yourself using nested loops and conditionals, and appending to lists! Course Chart