Question: wondering about this python program? You need to quickly determine the number of characters stored in a data file. Zelle (section 5.9) reviews the commands

wondering about this python program?
wondering about this python program? You need to quickly determine the number

You need to quickly determine the number of characters stored in a data file. Zelle (section 5.9) reviews the commands to open and read the contents of a data file: = open(, ) .read() Write a function named readFile() that accepts the data file name as an String parameter The readFile() function should open the data file, read the contents into a String and count the number of characters. Finally, readFile() returns the number of characters found Notes: Two sample data files are provided with this assignment, but any plain text data file should work If the data file specified in the parameter does not exist in the same folder as the Python program, the function will stop and display an error. This is normal. The function will not print() any values, it will return the Integer Examples of the readFile() function: >>> readFile('filel.txt') 882 >>> readFile('file2.txt') >>> readFile('file3.txt') 43

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!