In python 3.x I want to run the while loop for all the elements of mass_list and the output should also be in a list. but my loop is taking only the last value.
input:
mass_list = [1969,100756]
expected output:
[966,50346]
my code is---
for a in mass_list:
mass_sum = 0
total_mass_sum = []
while a >= 6:
i = (int (a/3)-2)
mass_sum = i+mass_sum
a = i
total_mass_sum.append(mass_sum)
print(total_mass_sum)
where am I going wrong?