Expression that returns mutated list
Expression that returns mutated list Question: I’m looking for a single expression, mutates an element and returns the modified list The following is a bit verbose # key=0; value=3; rng=[1,2] [(v if i != key else value) for i, v in enumerate(rng)] Edit: I’m looking for a way to inline the following function in a …