I know that this is a rather silly question and there are similar ones already answered, but they don\'t quite fit, so... How can I perform the same operation on multiple variab
Map is your friend here, but you also need to use 'implicit tuple unpacking':
>>> a = 3 >>> b = 4 >>> c = 5 >>> d, e, f = map(lambda x: x * 2, [a, b, c]) >>> d 6 >>> e 8 >>> f 10
This way you can get the changed values back without modifying the original values