With a JSON string such as '{"lat":444, "lon":555}', json.loads() creates a dictionary, so to get its values, you do so as you would get the values in a dictionary. Iteration over a dictionary is an iteration over its keys (for j in data: is the same as for j in data.keys():); however, to iterate over its values, you need to use .values():
import json
data = json.loads('{"lat":444, "lon":555}')
print(type(data)) # <class 'dict'>
print(data) # {'lat': 444, 'lon': 555}
for j in data.values(): # <--- iterate over values
pass
Note that json.loads converts json arrays into lists. If you need to get a value of a dictionary in a list, then you will need to index the list for the dictionary first to get the value. This is an easy mistake to make especially if an API returns a JSON array with a single object in it. For example:
s = '[{"lat":444, "lon":555}]'
data = json.loads(s) # [{'lat': 444, 'lon': 555}]
data['lat'] # <--- TypeError
data[0]['lat'] # <--- OK
If you want to get values from a JSON document, then open the file first and pass the file handle to json.load() instead. Depending on the document structure, json.load() would return dictionary or list, just like json.loads().
import json
with open('data.json', 'r') as f:
data = json.load(f)
for j in data.values():
pass
' '.join(data)