Grasshopper Python component. Work with list inside Python component

Phyton list.gh (23.9 KB) Hi all,
I am beginner user in scripting. Please help me. I am working with Phyton component inside Grasshopper and now have a problem with lists. Please look my sample a repair my script. All questions inside Python components.
Sample 1 questions

Where is mistake? How to select polylines items? How to flatten polyline list?

Sample 2 questions
###How to correct convert input list in the Phyton?

I am using this info https://developers.google.com/edu/python/lists?hl=ru