Discover the best answers to your questions with the help of IDNLearn.com. Find in-depth and accurate answers to all your questions from our knowledgeable and dedicated community members.
Answer:
import csv
fileIn = open("data/bags.txt","r")
countPurse = 0
textFile= csv.reader(fileIn)
for bag in textFile:
if bag[ 1 ] == 'purse':
countPurse = countPurse + int(bag[6])
fileIn.close()
print("Number of purses:",countPurse)
Explanation:
I hope this helps!