Convert float to string python 3

Code:

def post1(sent):
res = {}
res['Negative'] = sent[0]
res['Positive'] = sent[1]
res['Neutral'] = sent[2]
return json.dumps(res)

Problem: this code will this ERROR

TypeError: Object of type ‘float32’ is not JSON serializable

Solution:

def post1(sent):
res = {}
res['Negative'] ='%f' % sent[0]
res['Positive'] ='%f' % sent[1]
res['Neutral'] ='%f' % sent[2]
return json.dumps(res)