Question: (CODE MUST BE IN PYTHON) Write a function called jsontolist(string) that accepts a string argument that will have the JSON format specified above. You can
(CODE MUST BE IN PYTHON) Write a function called jsontolist(string) that accepts a string argument that will have the JSON format specified above. You can assume any string your function will be given has the proper format. This function must use string and list operations to extract each key/value pair and return them in a 2D list. For example, if the JSON string is:
{"firstname":"dave","lastname":"mckenney","position":"instructor"}
The function should return a 2D list that looks like:
[ [firstname, dave], [lastname, mckenney], [position, instructor] ]
Each element in the returned list is a list with two elements corresponding to a key and its matching value. Several JSON strings and their corresponding lists are included at the end of the tutorial document so you can check your function before proceeding.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
