I have an if statement that is picking which diameter is closest to the avg. In the statement I have the same variable equal to the vertical_tube_d for both if and else because later in the code i am writing to a file and needed one common variable. So the code is supposed to pick the closest and later in the code write that diameter.
def pick_diameter(d1, d2, avgd):
if abs(avgd-d1) < abs(avgd-d2):
vertical_tube_d = d1
else:
vertical_tube_d = d2
Is this a problem/will it confuse the computer?