1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Masja [62]
2 years ago
13

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

mposed 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 below. 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 import csv fileIn = open("data/bags.txt","r") countPurse = 0 textFile= csv.(fileIn) for bag in textFile: if bag[1] == 'purse': countPurse = countPurse + int(bag[6]) fileIn.close() print("Number of purses:",countPurse)
Computers and Technology
1 answer:
Volgvan2 years ago
5 0
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)
You might be interested in
In Python which is the correct method to load a module math?
Wittaler [7]

Answer: The math module is a standard module in Python and is always available. To use mathematical functions under this module, you have to import the module using import math .

Explanation:

3 0
2 years ago
What are your initial thoughts regarding copyright and fair use after watching the clip?
Elanso [62]
The answer is A you’re welcome
5 0
3 years ago
Carbon monoxide poisoning can result from breathing
Mamont248 [21]
The answer is the letter a
6 0
3 years ago
Hi, please help me, solution.​
loris [4]

Answer:

error: incompatible types

Explanation:

Given

The attached code

Required

The output

Variable "a" is declared as float

While p is declared as a pointer to an integer variable

An error of incompatible types will be returned on line 3, <em>int *p = a;</em>

Because the variables are not the same.

To assign a to p*, we have to use type casting.

Hence, (b) is correct

5 0
3 years ago
Which is true regarding networks?
shutvik [7]
Local Are Network (LAN) is a network that connect computer (or other network devices) in a limited area (local area).
Wide Area Network (WAN) on the other hand is a network that connects computers on a a large geographical area. According these definitions, the following statement is true:
C) wide are network allow users to share files with a secure connection

4 0
3 years ago
Read 2 more answers
Other questions:
  • Parameter variables should not be changed within the body of a method because _______________. Select one: a. it mixes the conce
    5·1 answer
  • g Write a program to sort an array of 100,000 random elements using quicksort as follows: Sort the arrays using pivot as the mid
    7·1 answer
  • George and Miguel want to know more about their local and online competitors and about the retail industry. What is the best way
    9·1 answer
  • What is the post condition of an expression or variable
    11·1 answer
  • Among the rights you have as a user of computing resources is the right to​ _______.
    12·2 answers
  • The hardware to keep the output data when finished is a
    9·1 answer
  • Imagine a mythical set of protocols with the following details. Maximum Link-Layer data frame: 1,455 bytes Network-Layer header
    8·1 answer
  • Fill up the blank:- The picture that graphically represents the items you use in Windows is called a/an .......
    5·1 answer
  • Indica si los elementos de las imagenes son una materia prima o un material elaborado
    12·1 answer
  • Molly claims that she doesn’t have to proofread her code for typos because the interpreter will catch her mistakes for her. Is s
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!