Complete the code to finish this program to analyze the inventory for a store that sells purses and backpacks.

Each record is composed of the catalog number, the type of item, its color, the length, width, height, and the quantity in stock.

Sample rows of the file are bel[w.

234 purse,blue, 12,4,14,10

138,purse,red, 12.4.14,4

934, backpack, purple, 25,10,15,3

925, backpack,green 25,10,15,7

Answers

Answer 1

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!


Related Questions


Which of the following types of networks covers a range of up to ten meters in distance?

Answers

Answer:

is there a pic

Explanation:

Other Questions
anybody know the answer it's science but more ppl is on the math side Is it possible for an even degree polynomial to have no real zeros? describe three small changes that you can make to your current eating habits to support a healthier lifestyle. 1.)20 is twice as much as 10 (True or False2.)10 is twice as much as 20 (True or False)3.)30 is double 15 (True Or False)4.) 15 is double 30(True or False) What are the two types of adaptations that plants can show?a.Physical characteristics and life cycle differences.b. Life cycle differences and color differences.c. Physical characteristics and different food sources.d. Physical characteristics and behavioral differences. A bicycle with 24-inch diameter wheels is traveling at 12 mi/h. Find the angular speed of the wheels in rad/min. What is the slope-intercept form of the equation of a line with a slope of 2 and a y-intercept of -7? a. y = 2x - 7b. 7x - y = -2c. y = -2x + 7d. y = -7x + 2 A bicycle has a listed price of $682.99 before tax. If the sales tax rate is 8.25%, find the total cost of the bicycle with sales taxincluded.Round your answer to the nearest cent, as necessary. HELPPPP PLS IM BEING TIMED!! 10 POINTS consider the pairs of ratios given in the first column and determine whether or not the ratios form a proportionRatiosYes, they areproportionalNo, they are notproportional8 old rings for every 1 new ring 16 old rings for every 2new ringso$9:4 visitors - $18:8 visitors16 e mails to 6 text messages - 10 e-mails to 4 textmessagesSHOW HINT what is fusion In government How could crusades change a serfs life ? Evaluate the extent to which technology transformed the United States economy in the period from 1865 to 1898. Help meeee!Write your own real-world scenario where the Pythagorean Theorem can be applied to find a missing piece. You may choose to write a problem that is two- or three-dimensional in nature. Be sure that you will be able to draw a diagram of your scenario.Write out your problem and submit it for Part 1. Be sure to end your scenario with a question. Pls, help!!! will give brainless to the first person who answers CORRECTLY!! BUT I NEE IT NOW!!FROM THE BOOK OF REVELATIONS: The ___ proceeds out of the ____ of God and of the Lamb. This is a political cartoon drawn by Benjamin Franklin. What outcome was Franklin advocating for with the cartoon?A. advocate for an alliance with American Indian peoples. B.To persuade the colonies to stand united in the French and Indian War. C.To convince the colonies to join the cause of independency . D.To support the passage of the Navigation Acts to improve the colonial economy 1. What are commonly called as "shooting stars"?A. asteroidsB. cometsC. meteorsD. meteorites2. What are found in the circular or somewhat like "doughnut-shaped"region between Mars and Jupiter?A. asteroidsB. cometsC. meteorsD. meteorites3. Which Near-Earth Objects (NEO) are found on the Kuiper Belt and OortCloud?A. asteroidsB. cometsC. meteorsD. meteorites4. What are comets made of?A. dust onlyB. metal onlyC. dust and metalD. dust, metal, and ice5. What do you call the shining "head" around a comet?A. comaB. crownC. haloD. ring The sides of a square garden are x? yards long. The area inside the garden is 49 square yards. What is the value of x?Oa. 49 yardsOc 77 yardsOb. 7 yardsO d. 2 yards Mr. Lee mailed 3 packages. The greatest amount he paid to mail one of these packages was $3.60. The least amount he paid to mail one of these packages was $1.70. What could be the total amount Mr. Lee paid to mail the packages? while in exile how djd jews maintain there identitity what technology and knowledge did the spanish need to get to tenochtitlan