1591
Off Topic / Re: Programming Megathread
« on: December 14, 2016, 09:50:25 PM »
so im having some trouble with this basic program in python: the idea is that it will ask a user to enter in numbers, it will put those numbers in a list, and then it will use a loop to add up those numbers. what am i doing wrong here?
Code: [Select]
def main():
keep_numbering = 'y'
numbers = []
while keep_numbering == 'y':
num = input("What was the sale for this day?: ")
numbers.append(num)
keep_numbering = input("Do you want to add another sale? (y/n): ")
for index.num in range(len(numbers)):
total = sum(numbers)
main()