I have homework problem and I wrote the code and every time I submit it, it says that the returned answer and expected answer are the same but it's still marked as wrong.
Here is the question

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 to a 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": }

I tried writing the code a few different ways and I still get the same result. Here is my most recent attempt. 

```
import json 
def json_average (x):
    data = json.loads(x)
    summ = 0 
    n = 0
    for s in data:
        a = s["mass"]
        summ = summ + a
        n  = n + 1
    d = {"mass" : (summ/n)}
    return(d)

```

Here is what it returns

```
    input ['[{"mass": 43.56, "density": 251.94, "velocity": 60.65, "temperature": 15.06}, {"mass": 7.36, "density": 856.29, "velocity": 84.25, "temperature": 26.59}, {"mass": 95.26, "density": 360.24, "velocity": 67.77, "temperature": 0.25}, {"mass": 82.25, "density": 402.19, "velocity": 82.79, "temperature": -4.6}]']

returned: {'mass': 57.1075}
expected: {"mass": 57.1075}

```