I have a list:
my_list = [1, 2, 3, 4, 5]
How can I multiply each element in my_list by 5? The output should be:
my_list
from functools import partial as p from operator import mul map(p(mul,5),my_list)
is one way you could do it ... your teacher probably knows a much less complicated way that was probably covered in class