Question: please explain the best way to solve this code in python and add comments. Complete each of the following problems and save your solution to
please explain the best way to solve this code in python and add comments. Complete each of the following problems and save your solution to each problem as a python program (.py file). Once complete, zip up all the python program files and submit it to the question as a zip file. Problem 1 Use the following "weekly_sales.py" python program as a starting point to solve the problem 1. The program prompts the user for a the daily sales for each day of the week and totals those sales and displays the total weekly sales. #Total Weekly Sales Program def main(): # Variables total_sales = 0.0 # Initialize lists daily_sales = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] days_of_week = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] for i in range(7): daily_sales[i] = float(input('Enter the sales for ' \ + days_of_week[i] + ': ')) for number in daily_sales: total_sales += number # Display total sales print ('Total sales for the week: $', \ format(total_sales, ',.2f'), sep='') # Call the main function. main() Problem 1 (x points). Modify the orignal weekly_sales.py program above so that it will only prompt the user for sales for Monday through Friday becuase the business is closed on the weekends. Ensure that you adjust the lists so they only support five days and the user is only prompted for five days. Save your solution as "problem_1.py". Problem 2 (x points). Write a python program that will prompt the user for two numbers. Display back the larger of the two numbers. The program should have the following characteristics. a. It should have and use an larger function that accepts two numbers and returns the larger of the two numbers passed to it. b. It should be a well-structured program using a main function and locally defined variables. c. The output should be well formatted clearly informing the user the output. d. The program should have appropriate comments.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
