Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started