I have a function to process the list of tuples. What is the easiest way to include for
loop inside the function itself? I am fairly new to python, trying to convert this in OOP function. Any help will be appreciated.
My current solution:
tups = [(1,a),(2,b),(5,t)]
def func(a,b):
# do something for a and b
return (c,d)
output = []
for x, y in tups:
output.append(func(x,y))
output will be
[(c,d),(m,n),(h,j)]