folks,
I want to modify list element with list comprehension. For example, if the element is negative, add 4 to it.
Thus the list
a = [1, -2 ,
Why mutate, when you can just return a new list that looks like you want it to?
[4 + x if x < 0 else x for x in [1, -2, 2]]