That's a python question. See for instance, https://stackoverflow.com/questions/2582138/finding-and-replacing-elements-in-a-list
If you scroll down, there are some suggestions there that deal with multiple replacements as well On Tuesday, 28 December 2021 at 06:09:35 UTC-8 cyrille piatecki wrote: > First I have seen that perhaps my question has an answer in AskSagemath > but currently it doesn't answer. > > Suppose I have a list of variables x_1, x_2, x_3,...x_n > > I have some sub-list of variables say [x_4, x_1, x_6...]. But whenever > x_4, x_5,x_6 belong to this list I want the substitution x_4 ->epsilon_0, > x_5 -> epsilon_1... (this is an only an example. Is there a way to do this > in the same way that we have a substitution in a fonction in Sagemath? > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/764fe9f5-d8b3-4033-afcf-183474f5e318n%40googlegroups.com.