I thought my question should've been pretty common but I couldn't find the answer online. I have a function that takes in 2 arguments and has 2 outputs. I want to run a list of these 2 arguments through the function and assign the output to the element in the list. Let me explain, the 2 arguments are in these 2 lists:
Lengths = [self.xS, self.yS, self.zS, self.Len1, self.Len2, self.Thick]
LengthsUnit = [self.xSUnit, self.ySUnit, self.zSUnit, self.Len1Unit, self.Len2Unit, self.ThickUnit]
The for loop I have constructed to run these arguments through the function looks like this:
for length, unit in zip(Lengths, LengthsUnit):
length, unit = ConvertToSIVarUnit(self, length, unit, 'meter', 'Length')
After completion, I want the things in the list (take self.xS for example) to be modified. So the output of the first print statement should be different from the last:
Lengths = [self.xS, self.yS, self.zS, self.Len1, self.Len2, self.Thick]
LengthsUnit = [self.xSUnit, self.ySUnit, self.zSUnit, self.Len1Unit, self.Len2Unit, self.ThickUnit]
print(self.Xs)
for length, unit in zip(Lengths, LengthsUnit):
length, unit = ConvertToSIVarUnit(self, length, unit, 'meter', 'Length')
print(self.xS)
But the output of the 2 print functions are the same so the for-loop-function combination might not be working.