Question: By using python, Write a program that computes all of the following statistics for a file and outputs the statistics to both the screen and

By using python,

Write a program that computes all of the following statistics for a file and outputs the statistics to both the screen and to another file:

the number of occurrences of each characters other than whitespaces in the file

the total number of whitespace characters( , , \t) in the file

the total number of occurrences of characters in the file

The program should input the filename. If the file does not exists, the program should print Could not open that file : filename on the screen.

The program should output statistics to the file named input_filename-out.txt

ex) If the input filename is text.txt, the output filename should be text-out.txt

The program should output the number of each characters in ASCII order.

The program should output 8 pairs of each character and the number of occurrences per line.

The program should use only lists and list methods. The program should not use string methods.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!