Replacing values of list by custom values

Dear Friends,
How can we replace all values of list by custom values and keep current list sizes same.

1 Like

I’m a little confused by that question.
Are you trying to replace each individual values from the left list (111,222) with only (pcs) or multiple values.
Seems to me like you need to use a dictionnary

Dear Daniel,
i just want to replace all with “pcs” value. As you can see in the attached photo.

Hi @kvusal
are you trying to do something like this ?

The ProcessList function is inspired by @Konrad_K_Sobon 's work .

def ProcessList(_func, _list):
	return map( lambda x: ProcessList(_func, x) if type(x) == list else _func(x), _list )
def replace(x):
	return IN[1]

l = ProcessList(replace,IN[0])

OUT = l
1 Like

Interesting. There is no way to do this without python? :blush:

A little hacky, but it works :slight_smile: :

2 Likes