I have the following arguments:
a = [(3, 3)]
b = [(2, 0), (1, 0), (0,1), (0,2), (1,1)]
I need to write a function that generates a list of tuples where each element is a unique summation of a
and the elements of b
. This is my expected result:
c = [(5, 3), (4, 3), (3, 4), (3, 5), (4, 4)]
I am having trouble writing this into a function that will work regardless of what tuple is inputted in a
. I can write the code that works on one individual element via the below:
import operator
a = 3, 3
b = 2, 0
result = tuple(map(operator.add, a, b))
How can I turn this into a reproducible function? I have tried several avenues / syntax and believe I am missing something simple.