Sort Float list-Python

import rhinoscriptsyntax as rs
a = [ ]
curve1 = curve[0]
for curve2 in curve:
    if (curve1 != curve2):
        c1 = rs.CurveAreaCentroid(curve1)
        c2 = rs.CurveAreaCentroid(curve2)
        pt1 = c1[0]
        pt2 = c2[0]
        dist = rs.Distance(pt1,pt2)
        SortL = sorted(dist, key = float)

Hello,I was trying to calculate the distance between the center points of curves. After I get all the distance between points, I tried to sort the list, but looks like I can’t run sorting in a iteration?
Any idea how to fix it? (17.7 KB)

In your script, dist is a float not a list of floats and thus can’t be sorted!