Hello @kartik,
json.dumps() returns the JSON string representation of the python dict.
You can't do r['rating'] because r is a string, not a dict anymore
Perhaps you meant something like
r = {'is_claimed': 'True', 'rating': 3.5}
json = json.dumps(r) # note i gave it a different name
file.write(str(r['rating']))
Thank You!!