Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question # 1 dropdown finish the code to open a file to retrieve its co…

Question

question # 1
dropdown
finish the code to open a file to retrieve its contents.
import csv
infile = open(pets.txt, )

Explanation:

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').

Answer:

'r'