Question
(CODE MUST BE IN PYTHON) Write a function called setvalue(jsonlist, key, newvalue) that accepts three arguments: a 2D JSON list in the format returned by
(CODE MUST BE IN PYTHON)
Write a function called setvalue(jsonlist, key, newvalue) that accepts three arguments: a 2D JSON list in the format returned by the function in Problem 1([ [firstname, dave], [lastname, mckenney], [position, instructor] ] ), a string/key specifying the key you want to set the value for, and a string/value that should represents the new value for the given key. For example, if you had the same mylist variable from Problem 2 and you executed setvalue(mylist, position, president), mylist would then look like:
[ [firstname, dave], [lastname, mckenney], [position, president] ]
Step 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