Multiple choice

which command is used to open a text file called myFile.txt for reading?

  1. open("myFile.txt", "w")

  2. file.open("myFile.txt", "r")

  3. file = open("myFile.txt", "r")

  4. open = filename("myFile.txt", "r")

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The built-in open function is used to open files, and 'r' is the mode for reading.