Python programming assignment
Sample Assignment Assignment 7 Name: ___________________________ CSC-1110 Section: ______ Assignment 7 COMPLETE THE HONOR CODE BELOW HONOR CODE: I pledge that this program represents my own program code, I have received help from no one and I have given help to no one. OR I received help from NAME OR NO ONE in designing and debugging my program. I have given help to NAME OR NO ONE in designing and debugging my program. This assignment is required. The grading form shows point values for this assignment. Please review it now. Show screen shots of the python code with comments and your input/output window. You should use several well-planned sets of data to check out your program. Testing your programs with just the data that is asked for in the assignment does not necessarily mean that the programs will work for all cases. Please include the following comments in each of your Python programs: Your Name Section Date Description Assignment Number A python template (python_template.py) has been provided for you to use. Name this document XXX_Assignment 7 where XXX are your initials. Include a python file named P01.py, P02.py, etc. for each problem. 1. Write a program that asks the user for a stock’s closing price for each day of the week. The program will then state which day of the week was largest and which one was the lowest. Here is the sample program you are to run: Enter the stock’s closing price for Monday: 12.10 Enter the stock’s closing price for Tuesday: 11.54 Enter the stock’s closing price for Wednesday: 13.48 Enter the stock’s closing price for Thursday: 16.54 Enter the stock’s closing price for Friday: 11.806 The stock’s highest closing price was Tuesday with 11.54 The stock’s lowest closing price was Thursday with 16.54 Comment your source code and describe your code to someone who may be viewing it for the first time. PLACE SCREEN SHOTS OF THE PYTHON CODE AND ALL I/O BELOW. 2. Write a program that takes a list of numbers and prints out the stats for it. The stats are as follows: · The sum of all even numbers in the list. · The sum of all odd number in the list. · The average of all the numbers · The range (is the highest value – (minus) lowest value) Note: You are not to hardcode the count of items in the list. Here are the lists of numbers to use: #lists of numbers numbers_list = [1, 12, 13, 74, 35, 26, 67, 98, 19, 44, 55, 97, 71] PLACE SCREEN SHOTS OF THE PYTHON CODE AND ALL I/O BELOW. Write a program that asks the user to enter a number. After entering that number, the program should ask if the user has additional numbers to enter. If the user enters a ‘y‘ continue asking for another number. Make sure the user only enters a ‘y’ or ‘n’. If the user enters any other value loop until a valid value is entered. This cycle should continue until the user enters a ‘n’, stating that they do not want to enter another number. When the user enters ‘n’ output every number they entered. Run this program twice and show the input/output from each run. Run 1: 45, y, 9, ‘y’, 8, ‘yes’, ‘yup’, ‘ok’, ‘y’, 144, ‘n’ Run 2: 101, y, -47, ‘y’, -32, ‘nope’, ‘no’, ‘n’ PLACE SCREEN SHOTS OF THE PYTHON CODE AND ALL I/O BELOW.