Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write code in python. name grade Jack 80 Joe 70 Jill 83 In table [ Iname, grade [ Jack, 80, IJoe, 70], tJill, 83] Write

write code in python.image text in transcribed

name grade Jack 80 Joe 70 Jill 83 In table [ I"name", "grade" [ "Jack", 80, I"Joe", 70], t"Jill", 83] Write a function that converts table from a list of lists to a list of dictionaries. 1. The first row is considered the keys of the records. 2. The rest of the rows in table are the records. 3. Your function must be pure, namely it does not modify table when computing the new list. In [1: def table_to_records (table): # YOUR CODE HERE raise NotImplementedError) In assrt (table to_records (table) -['name: 'Jack', 'grade': 80, ('name': Joe, 'grade' 70, ('name': 'Jill'. 'grade': 831) Write a function that converts table to a dictionary that maps student names to their grades In def student_grades (table): # YOUR CODE HERE raise NotImplementedError) In [ ]: assert ( student-grades (table) ('Jack': 80, "Joe': 70, "J11': 83})

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

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

More Books

Students also viewed these Databases questions