How can I write a definition for a function that is passed a list of numbers and returns the sum of the numbers in that list using a while loop?
I'm trying this, but it's not working
num = [1,2,3]
sum = 0
while num != str:
for i in num:
sum += i
Is there a way to not even use for?