Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON 2.7 It is important to be familiar with the functions of dictionary: items(), keys0), values0, write a program to use all these functions. Notes:

PYTHON 2.7image text in transcribed

It is important to be familiar with the functions of dictionary: items(), keys0), values0, write a program to use all these functions. Notes: Dictionary has two ways to initialize data dict0) datal'school] 'SChoolname' al'address'] = ,1000 School Avenue, Location, State 11111, data['phone'] ="(123) 789-0123 data = { 'school': 'SChoo!name', 'address','1000 School Avenue, Location, State 111 1 1', 'phone': '(123) 789-0123') Print the results as follows by accessing the defined dictionary. school: SChoolname . phone: (123) 789-0123 Task 5: Data Serialization Use json to store above dictionary in task-5 and then print item, key and values. Notes: This task tells how to store a dictionary object to a file and then load the dictionary object from the file. In python, object of any type can be mostly saved in json format to a txt file. You need to be familiar with the following two json functions json.dumps(object), which dumps an ob- ject to a json format (string), json.loads(a json format string), which loads a json format string back to the original object. We do not care about if the original object is list, dictionary or others. json.dumps() can automatically recognize. Note, json.load(object) only can only load an object, not a file

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

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions