1)Write a program in Python ( VERSION 2) that reads an arbitrary-length file. -A
ID: 3601067 • Letter: 1
Question
1)Write a program in Python (VERSION 2) that reads an arbitrary-length file.
-All lines that start with semicolons (;) or pound signs (#) should be ignored.
-All empty lines must be ignored
-Lines containing a string between square brackets are sections.
-Within each section, lines may contain numbers or strings.
-For each section, calculate the lowest, highest and modal (most common) number, and print it. In each section, also count all non-whitespace characters, and print that.
Example input file to use with this program:
Your program must print the following output
Explanation / Answer
First I am assuming the arbitary length file is a text file => test.txt.
break
#Now use for loop or any loop to find the lowest , highest, and the modal and the nonwhitespace characters and print it.
Thanks, If u face any problem let me know.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.