Grasshopper python command combining two if commands

SortedCurves = sorted(curvess, key=lambda crv: crv.PointAt(0).Z)

Am I doing It wrong?

SortingPolylines.gh (11.1 KB)