Question: Problem 1 Question 1 Write a function that takes in a list of tuples containing two elements and converts it into a dictionary. Return the

 Problem 1 Question 1 Write a function that takes in a

Problem 1 Question 1 Write a function that takes in a list of tuples containing two elements and converts it into a dictionary. Return the resulting dictionary. def list_to_dict(input_list): ### ### YOUR CODE HERE ### list_to_dict([('Chris', 'A'), ('John', 'A-'), ('Mia', 'A'), ('Emily', 'B'), ('David', 'B+')]) #{ 'Chris': 'A', 'John': 'A', 'Mia': 'A', 'Emily': 'B', 'David': 'B+'} ### AUTOGRADER TEST - DO NOT REMOVE ### AUTOGRADER TEST - DO NOT REMOVE Question 2 Write a function that takes a dictionary and a username(key) as inputs. Return the value stored at username passed in. If the name does not exist, return an error message def retrieve_grade (input_dictionary, name): ### YOUR CODE HERE ### print(retrieve_grade({'Chris': 'A', 'John': 'A', 'Mia': 'A', 'Emily': 'B', 'David': 'B+'},'John')) #A- print(retrieve_grade({'Chris': 'A', 'John': 'A', 'Mia': 'A', 'Emily': 'B', 'David': 'B+'},'Greg')) #Error: Greg not in grades ### AUTOGRADER TEST - DO NOT REMOVE ### AUTOGRADER TEST - DO NOT REMOVE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!