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

PDF
please fix this code so that the tests pass css Selec.pdf
PDF
please help Below are the ages at which US presidents bega.pdf
PDF
please fill in the blanks below the proc structure .pdf
PDF
Please explain these steps Not sure how to go from first li.pdf
PDF
Please help Edgar Given the following API for a mutable Em.pdf
PDF
Please graph the spectrum using only MATLAB and provide the .pdf
PDF
please help Let X and Y be random variables with joint dens.pdf
PDF
Please go through the Review Article and submit a summary of.pdf
please fix this code so that the tests pass css Selec.pdf
please help Below are the ages at which US presidents bega.pdf
please fill in the blanks below the proc structure .pdf
Please explain these steps Not sure how to go from first li.pdf
Please help Edgar Given the following API for a mutable Em.pdf
Please graph the spectrum using only MATLAB and provide the .pdf
please help Let X and Y be random variables with joint dens.pdf
Please go through the Review Article and submit a summary of.pdf

More from kitty811 (20)

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

Recently uploaded (20)

PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
1_English_Language_Set_2.pdf probationary
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
Cell Types and Its function , kingdom of life
PDF
RMMM.pdf make it easy to upload and study
PDF
Complications of Minimal Access Surgery at WLH
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Hazard Identification & Risk Assessment .pdf
PPTX
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
PDF
Empowerment Technology for Senior High School Guide
PPTX
Lesson notes of climatology university.
PDF
Trump Administration's workforce development strategy
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Computing-Curriculum for Schools in Ghana
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
UNIT III MENTAL HEALTH NURSING ASSESSMENT
LDMMIA Reiki Yoga Finals Review Spring Summer
1_English_Language_Set_2.pdf probationary
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Cell Types and Its function , kingdom of life
RMMM.pdf make it easy to upload and study
Complications of Minimal Access Surgery at WLH
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Hazard Identification & Risk Assessment .pdf
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
Empowerment Technology for Senior High School Guide
Lesson notes of climatology university.
Trump Administration's workforce development strategy
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Final Presentation General Medicine 03-08-2024.pptx
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Computing-Curriculum for Schools in Ghana
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf

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