Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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. thximage text in transcribed

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

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions

Question

2. What, according to Sergey, was strange at this meeting?

Answered: 1 week ago