Question: Spring 2 0 2 4 Extra Credit Assignment 1 Due date: May 1 This is an extra credit assignment. It is not part of the
Spring
Extra Credit Assignment
Due date: May
This is an extra credit assignment. It is not part of the required assignments for the course.
As was discussed in class, there are several useful methods and functions that operate on Python lists. They perform operations that are frequently needed in the design of algorithms. Three of those operations are finding the minimum value of a list, finding the maximum value of a list, and summing the numeric values contained in a list. The functions to perform thoseoperations are:
minalist
maxalist
sumalist
Each of those functions accepts a Python list as a parameter, performs the corresponding operation, and returns the appropriate result.
For this extra credit assignment you are to write three separate Python functions that perform the same operation as the and sum functions. In your solution for the assignment you should name your version of the functions mymin mymax and mysum Your version of the functions should also accept a Python list as a parameter you can assume the parameter will be a list of integer values and return the same result as the and sum functions. However, your versions of the functions should not use the or sum functions. Instead, you should use the concepts and techniques that have been covered in class to create your own implementations that do not require the use of the min max or sum functions.
Make sure to test your functions from the main program part of a Python file. Your program should print results to show that your version of the functions work correctly. An easy way to show your functions work correctly is to create a list of integers, print the list of integers, and then print the result of first invoking the Python max and sum methods on the list, and then print the result of calling your implementation of each of the methods and on the same list.
Make sure to include appropriate comments in your source code to document your program. Those comments should include headings at the start of your code with your name, Knumber, and the date submitted. Also remember to follow the standard Python coding conventions discussed in class. Submit your solutions via the corresponding Blackboard system link for this extra credit assignment.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
