Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE_120 Sir_it_is_urgent.do_fast._Please_solve_this_code_in_python3_paste_with_proper_intendent_blocks_bypressing(CTRL+SHIFT+V),Also_please_provide_code_screenshot,_Thank_you. Do_not_need_comments. SKIP_BUILT_IN_FUNCTIONS. Just_give_me_solution_as_fast_as_possible._I_am_running_out_of_time._Attach_a_screenshot_with_yoursolve. Question-2: You have been given a dictionary and a list of tuples. Tuple has (key, value) pair. Write a program

CSE_120

Sir_it_is_urgent.do_fast._Please_solve_this_code_in_python3_paste_with_proper_intendent_blocks_bypressing(CTRL+SHIFT+V),Also_please_provide_code_screenshot,_Thank_you.

Do_not_need_comments. SKIP_BUILT_IN_FUNCTIONS. Just_give_me_solution_as_fast_as_possible._I_am_running_out_of_time._Attach_a_screenshot_with_yoursolve.

Question-2: You have been given a dictionary and a list of tuples. Tuple has (key, value) pair. Write a program that prints a dictionary where the values corresponding to those keys don't exist. Hint: use isinstance(value_to_check_type, data_type) for checking data type of values of dictionary ================================================ Given Input 1: dict1 = {"name": ["Alice", "Bob"], "initial": "F44", "city": "Dhaka"} list1= [("name", "Alice"), ("initial", "F44"), ("city", "Naogaon")]

Sample Output 1: {"name": "Bob", "city": "Dhaka"}

Explanation 1: Here the value of the key, value pair in the dictionary can be in list form. If unmatched values are greater than 1, then you need to put them into a list and add it to the output dictionary as a list. If it is one then you can just simply add it. Here for the name key we have one unmatched value which is Bob and for the city key we have one unmatched value which is Dhaka''. So, our output becomes, {"name": "Bob", "city": "Dhaka"} ================================================ Given Input 2: dict1= {"name": ["Alice", "Bob", "Martha"], "initial": "F44", "city": "Dhaka"} list1= [("name", "Alice"), ("initial", "F44"), ("city", "Dhaka")]

Sample Output 2: {"name": ["Bob", "Martha"]}

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

ISBN: 133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions