Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

your file, pets.txt, contains the type of pet, weight, and age on each …

Question

your file, pets.txt, contains the type of pet, weight, and age on each line. an example line is below: dog, 30, 6 finish the code to read the file and print the contents. import csv infile = open(pets.txt,r) myreader = for item in myreader: print(item)

Explanation:

Step1: Use csv.reader to create reader object

myReader = csv.reader(inFile)

Answer:

myReader = csv.reader(inFile)