Question: Starting out with Python Chapter 7 Programming Exercises #1 *I need a Flowchart for this Python program. * Total Sales Design a program that asks

Starting out with Python

Chapter 7

Programming Exercises #1

*I need a Flowchart for this Python program. *

Total Sales Design a program that asks the user to enter a stores sales for each day of the week. The amounts should be stored in a list. Use a loop to calculate the total sales for the week and display the result.

def total_sales(sales): total = 0 for sale in sales: total += sale return total

def main(): sales = [] for i in range(1, 8): sales.append(float(input("Enter sales of day " + str(i) + ": "))) print("Total sales of the week is", total_sales(sales))

main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!