Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python Greg's Grocery Store Time required: 30 minutes Greg's Grocery store would like a program to calculate the total sales for the week. Name:
Python Greg's Grocery Store Time required: 30 minutes Greg's Grocery store would like a program to calculate the total sales for the week. Name: total sales.py Author: Created: Purpose: Total weekly sales 9 def main (): #Initialize variable total sales - 0.0 # Initialize parallel lists daily sales = [] days_of_week = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ] # Append 7 items to the list, 0-7 index for i in range (7): sales float (input (f'Enter the sales for (days_of_week[i]): ')) daily_sales.append(sales) # Iterate through list one item at a time # accumulate total for number in daily_sales: total sales += number # Display total sales print (f'Total sales for the week: $(total_sales:, .2f}') 35 # Call the main function 36 if _main__': name main () Add the following features to the program: Use parallel lists to print out the day and sales for Monday through Friday only. Calculate and display the average daily sales for the week. (Calculate the average manually, don't use math functions.) Example run: Greg's Grocery Store Weekly Sales Enter the sales for Sunday: 100 Enter the sales for Monday: 150 Enter the sales for Tuesday: 200 Enter the sales for Wednesday: 175 Enter the sales for Thursday: 250 Enter the sales for Friday: 50 Enter the sales for Saturday: 100 Sales during the week days Monday: $150.00 Tuesday: $200.00 Wednesday: $175.00 Thursday: $250.00 Friday: $50.00 Total sales for the week: $1,025.00 Average sales per day: $146.43 Assignment Submission 1. Attach all Python program files to the assignment.
Step by Step Solution
★★★★★
3.51 Rating (164 Votes )
There are 3 Steps involved in it
Step: 1
Python code definition of the main method def main initialize the totalsales to 0 totalsales 00 decl...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started