Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This problem involves reading from and writing to files It also involves the Accumuator Pattern Where you would usually have a tab to indent, use

This problem involves reading from and writing to files It also involves the Accumuator Pattern Where you would usually have a tab to indent, use four (4) spaces. There is no prompting for file names. They are hardcoded. Input file name: data.txt Output file name: summary.txt The input file contains numbers, one number per line. You should write a complete Python program to calculate the average of postive numbers the average of negative numbers and a count of zeroes found in the input file. The format of any output MUST be duplicated. The following report should be written to the output file: Positive average : 17.2 Negative average: -12.1 Zeroes found: 1 After writing those three lines to the output file. The following line is printed to the screen: See summary.txt You should be computing the values shown on the three lines being written to the output file, if the input file contained the following numbers: 17.1-12.2; -1217.3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

In Exercises 6782, find each product. (32 - 4)(32 + 4y)

Answered: 1 week ago