Examveda

What is the output of the following code:
with open('data.txt', 'r') as file:
lines = file.read().splitlines()
print(len(lines))

A. The number of lines in data.txt

B. An error will occur

C. The content of data.txt

D. The file object file

Answer: Option A


This Question Belongs to Python Program >> Files Handling In Python

Join The Discussion

Related Questions on Files Handling in Python