<Apti
Code
/>
Back
Question 483: How can you open a file named "example.txt" in Python for reading?
tcs
wipro
infosys
general
aptitude
reading-and-writing-files
To open a file for reading, you should use the mode "r" in theopen()function.
open("example.txt", "w")
open("example.txt", "r")
open("example.txt", "a")
open("example.txt", "x")
Submit Answer
Show Answer
Previous
Next