How to Handle Variable Input List Length/Nesting in Custom Nodes (Python)

Hi guys ,
Thank you this is very helpful

but trying to change a python code to get variable input but actually with my little experience in python I did not succeed

the python script is provided by @Einar_Raknes by it only take one element as an input

Can anyone please solve this for me just to get more familiar with python scripts

Thank you