Compulsory Task 3 Follow these steps: Create a Python file called amazon.py in your folder. Write code to read the content of the text file input.txt. Tip: After stripping and splitting each line in the file, add the key.value pairs to a dictionary. For each line of data compute the answer for the min, max, and avg operations on a list of numbers. The input consists of the following data: O min: 1,2,3,4,5,6 max: 1,2,3,4,5,6 o avg: 1,2,3,4,5,6 O You should define the functions min, max, and avg that take in the respective list of integers and return the min, max, or avg of the list. Take Note: o You can assume that the only operations given in the input file are min, max, and avg, and that the operation is always followed by a list of comma-separated integers. O You can assume that the list of input numbers are always valid integers and that the list is never empty, so as not to have to write code to check for these cases. o Your program should handle any combination of operations and any length of input numbers. Finally, write the values returned from each function to a new line in a new text file output.txt. Your program should output as follows: o The min of [1, 2, 3, 4, 5, 6] is 1. o The max of [1, 2, 3,4, 5, 6] is 6. o The avg of [1, 2, 3, 4, 5, 6] is 3.5.
Compulsory Task 3 Follow these steps: Create a Python file called amazon.py in your folder. Write code to read the content of the text file input.txt. Tip: After stripping and splitting each line in the file, add the key.value pairs to a dictionary. For each line of data compute the answer for the min, max, and avg operations on a list of numbers. The input consists of the following data: O min: 1,2,3,4,5,6 max: 1,2,3,4,5,6 o avg: 1,2,3,4,5,6 O You should define the functions min, max, and avg that take in the respective list of integers and return the min, max, or avg of the list. Take Note: o You can assume that the only operations given in the input file are min, max, and avg, and that the operation is always followed by a list of comma-separated integers. O You can assume that the list of input numbers are always valid integers and that the list is never empty, so as not to have to write code to check for these cases. o Your program should handle any combination of operations and any length of input numbers. Finally, write the values returned from each function to a new line in a new text file output.txt. Your program should output as follows: o The min of [1, 2, 3, 4, 5, 6] is 1. o The max of [1, 2, 3,4, 5, 6] is 6. o The avg of [1, 2, 3, 4, 5, 6] is 3.5.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 3 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY