So I have the following example of code; simultaneously iterates over multiple sequences combined with enumerate, assigning the values to tuple variable after which outputs it.
def PairValuesWithIndexToTuples(self,val1,val2):
t =()
for i, (a,b) in enumerate(zip(val1,val2)):
t += (i,a,b)
return t
What I want to achieve is something like this if it is possible: I have been searching around but I could not find yet a solution which achieves my results from the method written above:
def PairValuesWithIndexToTuples(self,val1,val2):
t =()
t += for i, (a,b) in enumerate(zip(val1,val2))
return t
or
return t+= for i, (a,b) in enumerate(zip(val1,val2))