multiply all elements in a list of tuples for elements in a list

  list, python, tuples

I know it might sound easy but that problem is making me struggle.

I have a list of tuple as

[(0,1),(3,4)]

And I want to multiply all its values for all the values in a list like

[ 1, 2, 3]

So That in this case I will get a new list (nested) of tuples:

[[(0,1),(0,2),(0,3)],[(3,4),(6,8),(9,12)]]

How can I obtain this result?

Source: Python Questions

LEAVE A COMMENT