what am i doing wrong here?
design a program that asks the user to enter a store sales for each day of the week. The amount should be stored in a list. use a loop to calculate the total sales for the week and display the result in python
DAYS = 7
def main():
index = 0
sales = [0] * DAYS
while index < DAYS:
print('Day #', index + 1, ': ', sep='', end='')
sales[index] = float(input())
index += 1
total = 0
for index in range(DAYS):
total += sales
print('Enter the sales for each day.')
main()
Code.
DAYS = 7
def main():
index = 0
sales = [0] * DAYS
while index < DAYS:
print('Day #', index + 1, ': ', sep='', end='')
sales[index] = float(input())
index += 1
total = 0
for index in range(DAYS):
total += sales[index]
print('Total sales: ', total)
print('Enter the sales for each day.')
main()