# Answer to Question #52602 in Python for stephanie

Question #52602

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()

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()

Expert's answer

**Code.**

DAYS

**=**7

**def**main

**():**

index

**=**0

sales

**=**

**[**0

**]**

*****DAYS

**while**index

**<**DAYS

**:**

**(**'Day #'

**,**index

**+**1

**,**': '

**,**sep

**=**''

**,**end

**=**''

**)**

sales

**[**index

**]**

**=**float

**(**input

**())**

index

**+=**1

total

**=**0

**for**index

**in**range

**(**DAYS

**):**

total

**+=**sales

**[**index

**]**

**(**'Total sales: '

**,**total

**)**

**(**'Enter the sales for each day.'

**)**

main

**()**

## Comments

stephanie12.05.15, 07:36this is as far as i can get it to go :

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 sales in range(DAYS):

total += sales

print('total is: $ ', total)

print('Enter the sales for each day.')

main()

## Leave a comment