Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PHYTON Please follow the directions. Upvote for QUICK working code. Thank you. Write a program that opens file numbers.txt which contains a series of names

PHYTON Please follow the directions.

image text in transcribed

Upvote for QUICK working code. Thank you.

Write a program that opens file numbers.txt which contains a series of names followed by integers. The program read the data from the file and prints total number of integers, the sum of all the numbers, the count of even numbers, and the average of all the numbers. For example, if the input file contains the following text: Dan 3 Cordelia 7 Tanner 14 Mellany 13 Curtis 4 Any 12 Nick 6 Then the function should produce the following console output: count = 7 sum 3 59 evens = 4 average = 8.428571428571429 *numbers - Notepad File Edit Format View Help directions: create a text file and include the data save it as numbers open the file use loop to read the lines in the file counter for number of lines Acc to add all numbvers counter for number of even values and a condition ave. = sum / number of lines print

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

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions

Question

How does earning revenue affect the accounting equation?

Answered: 1 week ago

Question

What is a verb?

Answered: 1 week ago