Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python Task 1 It is important to be familiar with the functions of dictionary: items0, keys), values0, write a program to use all these functions
Python
Task 1 It is important to be familiar with the functions of dictionary: items0, keys), values0, write a program to use all these functions Notes: Dictionary has two ways to initialize data dictO data['school']- 'College' datal'address']-1000 data( 'phone'] = ,(1 1 1 ) 111-11 1 1 , data 'school': 'COllege', 'address': ' 1000 Main Ave, City, State 10000', 'phone': (1) 111-1' Print the results as follows by accessing the defined dictionary. school: College address: 1000 Main Ave, City, State 10000 phone: (111) 111-1111 Task 2 Main Ave, City, State 1000 Use json to store above dictionary in task-2 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 object 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(0 can automatically recognize. Note, json.load(object) only can only load an object, not a fileStep 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