What is the expected output of the following code if the file named zero_length_existing_file is a zero-length file located inside the working directory?
What is the expected output of the following code if the file named zero_length_existing_file is a zero-length file located inside the working directory?
The expected output of the code is 0. The file 'zero_length_existing_file' is a zero-length file, meaning it is empty and contains no characters. When the code attempts to read a line from this file using the readline() method, it will return an empty string. The len() function then calculates the length of this empty string, which is 0. Therefore, the output will be 0.
D is correct
is correct