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
why is it important for you to understand and describe the internal and external components of a computer in the workplace​
zhannawk [14.2K]

Hi! I have been troubleshooting and building PCs all my life and I find it very important to know the the internal core components of a PC and how they function that way when errors occur you can attempt to fix the problem.

Ex1: Lets say your BIOS identifies a problem with a RAM slot you would be able to know that your RAM slot is either shorted or there is a problem with the RAM stick you inserted.

Ex2: Now your monitor is flashing and turning colors randomly. You could make an inference that either your monitor is prongs are broken, your cable prongs could be bent, your cable might not be plugged in all the way, or your external or integrated GPU is toast.

Hope this might've showed you something

Aaron

7 0
3 years ago
In order to organize your work effectively on the computer, where is the best place to save it?
Morgarella [4.7K]
Your answer is -

B. Folder Is the best place to save it
8 0
3 years ago
Read 2 more answers
Which two computer peripherals are connected to the computer through a port?
chubhunter [2.5K]
Most computer devices are connected to the computer through port
Keyboard through usb port
Printer through usb port
Hand point device through usb port
Also computer equipped with LPT port for printers and COM port for additional devices like external modems e.t.c
7 0
3 years ago
What is an compiler?
marissa [1.9K]
The accurate answer is

A compiler takes your source code, it converts the entire thing into machine language and then stores these equivalent machine language instructions in a separate file. We programmers call that the "executable file.

Glad to help :)<span />
6 0
3 years ago
Read 2 more answers
What is the advantage of learning through story compared to learning through personal experience?
Inessa [10]

Answer:

Personal Experience

Explanation:

If a story is based on a personal experience then yes, the two doesn't matter. <em>However</em>, usually learning through personal experience is better because you learn firsthand while stories are written from a different perspective.

6 0
2 years ago
Read 2 more answers
Other questions:
  • Let's say you're creating a search stream in your hootsuite dashboard, to find mentions of the phrase vacation holiday getaway.
    15·1 answer
  • _______ refers to the poitically, religiously, or ideologically motivated use of computers (or related technology) by an individ
    15·1 answer
  • A byte is made up of 8 bits (binary digits). You have a programming language that uses one byte to represent characters and are
    5·1 answer
  • A two-dimensional array of characters can contain Group of answer choices
    11·1 answer
  • _____ of a global information system (GIS) concentrates on medium-range activities that move an organization toward achieving lo
    7·1 answer
  • Your organization uses a type of cryptography that provides good security but uses smaller key sizes and utilizes logarithms tha
    9·1 answer
  • Create a function called is_list_empty that takes a single argument of type list. Your function should return True if the list i
    7·1 answer
  • PYTHON:Given the dictionary, d, find the largest key in the dictionary and associate the corresponding value with the variable v
    12·1 answer
  • How to square a number in java.
    15·1 answer
  • Select the three subjects studied in sports biomechanics.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!