Answer to Question #325079 in Python for Kaira

Question #325079

Write a Python program that asks the user to enter a store’s sales for each day of the week. The sales amounts should be stored in a list. Use a loop to calculate the total sales for the week and display the result. Do not use built-in Python function like sum to perform the calculation


1
Expert's answer
2022-04-07T04:04:36-0400
def main():
    sum = 0.0
    dailySales =[]


    for i in range(7):
        dailySales.append(float(input(f"Enter the amount of sales for {i+1}: "))) 
        
    for i in range(7):
        sum += dailySales[i]
    print("The total sales for the week is $", format(sum, '.2f'))


main()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS