#to find the sum of a list of numbers using while loop
list = [10, 30, 50, 60, 90]
sum = 0
i = 0
while i < len(list):
sum+=list[i]
i+=1
print(sum)
Output:
240
#to find the sum of a list of numbers using while loop
list = [10, 30, 50, 60, 90]
sum = 0
i = 0
while i < len(list):
sum+=list[i]
i+=1
print(sum)
Output:
240