How to multiply all integers inside list [duplicate]
Try a list comprehension: l = [x * 2 for x in l] This goes through l, multiplying each element by two. Of course, there’s more than one way to do it. If you’re into lambda functions and map, you can even do l = map(lambda x: x * 2, l) to apply the function … Read more