Question: Need help on this question....not sure if i really get the question... please help with the code and the approach. thx python Write a function

Need help on this question....not sure if i really get the question... please help with the code and the approach. thxNeed help on this question....not sure if i really get the question...

python Write a function named "json average" that takes a JSON formatted string as a parameter in the format of an array of objects where each object has keys "mass", "density", "temperature", and "velocity" and each key maps toa floating point number. This function should return the average "mass" of all the objects in the array as a JSON string in the format ["mass: ) 1 import json 2 def json_average(x): counte sum-e Array json.loads(x) 4 6 for i in Array("density"): count +1 sum +arrayti] 9 return sum/count Submit for Practice error on input ['If"density: 556.84, "mass": 98.04, "temperature: -19.28, velocity": 58.37), f"density": 385.28, "mass": 1.16, "temperature": 9.24, "velocity 29.36), ["density": 237.16, "mass": 84.12, "temperature": -19.09, "velocity: 92.55), f"density": 872.85, "mass": 19.03, "temperature": 2.31, "velocity": 28.96)11: 'list

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!