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()
1
Expert's answer
2015-06-05T04:30:16-0400
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
Learn more about our help with Assignments: Python
Comments
stephanie
12.05.15, 07:36
this 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
Thank you! Your comments have been successfully added. However, they need to be checked by the moderator before being published.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
this 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