Vidyalelo
Python · Q1

Files Handling in Python

Programming · Python · question 1

Q1

How do you open a file named data.txt in read mode in Python?

A.
file = open('data.txt', 'r')
Answer
B.
file = open('data.txt', 'read')
C.
file = open('data.txt', 'read mode')
D.
file = open('data.txt')

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board