subject

Complete the code to finish this program to analyze the inventory for a store that sells purses and backpacks. (python) 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 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
aReader = csv. reader(fileIn)
for bag in aReader:
if bag[1] == 'purse':
countPurse = countPurse + int(bag[ ? ])
fileIn. close()
print("Number of purses:",countPurse)

6

7

5

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:00
What role do chromosomes play in inheritance?
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
What is outfitting a workplace with video in a technology
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
Write a full class definition for a class named player , and containing the following members: a data member name of type string .a data member score of type int .a member function called setname that accepts a parameter and assigns it to name . the function returns no value.a member function called setscore that accepts a parameter and assigns it to score . the function returns no value.a member function called getname that accepts no parameters and returns the value of name .a member function called getscore that accepts no parameters and returns the value of score .this is what i have, aparently this is wrong: class player{private: string name; int score; public: void player: : setname (string n){name =n; }void player: : setscore (int s){score = s; }string player: : getname (){return name; }int player: : getscore (){return score; }};
Answers: 2
question
Computers and Technology, 23.06.2019 10:20
Suppose there is a relation r(a, b, c) with a b+-tree index with search keys (a, b).1. what is the worst-case cost of finding records satisfying 10 < a < 50 using this index, in terms of the number of records n1, retrieved and the height h of the tree? 2. what is the worst-case cost of finding records satisfying 10 < a < 50 and 5 < b < 10 using this index, in terms of the number of records n2 that satisfy this selection, as well as n1 and h defined above? 3. under what conditions on n1 and n2, would the index be an efficient way of finding records satisfying the condition from part (2)?
Answers: 1
You know the right answer?
Complete the code to finish this program to analyze the inventory for a store that sells purses and...
Questions
Questions on the website: 13722361