I am trying to create a for loop like this:
list = [a, b, c, a_1, b_1, c_1]
for i in list:
if str(i).endswith(".0"):
i = int(i)
print(type(a))
This outputs:
<class 'float'>
This means that the for loop didn't define the entry into an integer. I checked if this works to make sure it was the for loop:
if str(i).endswith(".0"):
i = int(i)
Does anyone know why the for loop wouldn't define the variable the same as outside of the loop? Any help would be appreciated.