GHPython result as list of "other" then integer types

Hi all,
I want to go through a list of integers [ x ] and when two consecutive integers are equal, I want to replace one of them by another one, picked randomly from another list of integers [y].
So far the python code worked well. But the output seems to be a Python list that I cannot convert to a list of integer back in Grasshopper. I tried splitting the string but the “empty branches” are stubborn.
Could anyone help? I’m pretty sure there must be a way to output the integers directly from the Python code and not have to work this out in Grasshopper.


Frustrating List.gh (14.9 KB)

image

Why do you have to assign x = [x]? I see you already have set it to List Access on the component.

Comment out that part, and everything seems fine.

HTH

~ ~ ~ ~ ~ ~
Kaushik LS
Chennai, IN

Thanks Kaushik,
it works perfectly now!
Cheers,