Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how to correct the code in In [224] Appreciate it!!! Given a dictionary that instead maps majors to lists of names, repeat the above question.

how to correct the code in In [224]image text in transcribed Appreciate it!!!

Given a dictionary that instead maps majors to lists of names, repeat the above question. In [224]: def major_2 (major, name): tor n in name: m-maior 2.get(n) def check major (name, major, major 2): if majors 2 n m: return True else: return False In [225]: majors_2 - ["Engineering": ["Josh", "Robert", "Irene" ], "Accounting": "Carol", "Christine", "Charles" ], "Art History": "Douglas " ] check major2( "Douglas", "Art History", majors 2) == True Traceback (most recent call las NameError t) in () 1 majors-2 {"Engineering": ["Josh", "Robert", "Irene "], "Accounti ng": ["Carol", "Christine","Charles"], "Art History": [ " Douglas" ]) >2 check major2 ("Douglas","Art History", majors 2) True ipython-input-144-752f6b414378> in check major2 (name, major, major_2) list (n) 4 5 def check maior2 (name, maior, maior 2): x = if major 2 [m]X return True 8 else: NameError: name 'm' is not defined

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students also viewed these Databases questions