#LMGTFY
In this example, I have created an array of numbers called 'foobar', and while the variable 'sum' is less than 20, I will have the program continue to loop back and add the next number in the array sequence.
#!usr/bin/env
foobar = [1, 4, 7, 2, 9, 11, 0, 6, 5, 4, 16, 3]
sum = 0
iteration = 0
while(sum < 20):
sum += foobar[iteration]
iteration += 1
print("Finished!")
Copyright © 2026 eLLeNow.com All Rights Reserved.