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
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()
Comments
Leave a comment