This should do the trick
all_boxes =[list(map(lambda y : y*s, box)) for box in current_boxes]
We are using the build in python map() function,
it takes in as first argument a function that is applied to each element of the second iterable argument (a list in our case ).
the map() returns a iterable so we cast it to 'list' for obtaining the desidered result.
this 'lambda y : y*s' function can be also expressed in this way:
def mult_by_s(element):
element*s
all_boxes =[list(map(mult_by_s, box)) for box in current_boxes]
but it requires that 's' is global so lambda y : y*s is a better fit in my opinion.
Also another approach is to use only map function to resolve the problem
all_boxes =list(map(lambda box :list(map(lambda y : y*s, box)), current_boxes))