• Bigger Price, I'm confused

 

The mission is from here: https://py.checkio.org/en/mission/bigger-price/

my code is below, I used the basic coding, not the built in functions so I can practice how to work with dictionaries and understand them better, problem is, my code output is correct, but running it gives an error. Either I don't understand what the output needs to be or maybe something wrong with the code?

for i in data:
    for i in data:
        if j["price"] <= i["price"]:                                
             j["price"],i["price"] = i["price"],j["price"]

result = []            
for i in range(limit):
    result.append(data[i])
return result