QUESTION IMAGE
Question
question # 1
dropdown
finish the code to open a file to retrieve its contents.
import csv
infile = open(pets.txt, )
Step1: Identify file - opening mode
In Python, to read the contents of a text file, the mode 'r' is used.
Step2: Complete the code
The completed code for the open function call to read the 'pets.txt' file should be inFile = open('pets.txt', 'r').
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
'r'