Python does not show the result ( Tree structure)

I write a script which i want to sort some curve length based on their length diffrence, and store lengths that have less than 0.02 ratio in a branch.
Firstproblem is python does not give me the final result and the second problem is since i have a list that have other lists stored in it, i want my final result to be a tree in grasshopper.

Thank you for your help guys. (5.0 KB)