Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume that a file named record.txt contains a single dictionary object whose keys represent the names of students in CSC 1 3 0 and the

Assume that a file named record.txt contains a single dictionary object whose keys represent the names of students in CSC130 and the corresponding values are the the scores of students. This dictionary object has been serialized earlier to the file. Complete the following code that will
define a function that will load the dictionary object from the file and return the dictionary object.
define a function that accepts a dictionary object as an argument, removes every student whose score is zero from the dictionary object and returns the updated dictionary object.
define a function that accepts a dictionary object as an argument, calculates and displays the average score as a whole number.
import pickle as pk
def getDict():
fObj= oper
def removeZeros(dObj):
new_dObj ={}
for k, v in .items ():
if v0 :
return
def avg_score(dObj):
total_score =0
for k in dObj:
image text in transcribed

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

What is Working Capital ? Explain its types.

Answered: 1 week ago