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
valentina_108 [34]
3 years ago
6

Write a function called csv_sum that takes a filename and returns the sum of all of the numbers in the file. The numbers are in

csv format. For instance, if the contents of the file are: 12,3,2 -5 10,20,-10,8.3 Then the function should return 40.3.
Computers and Technology
1 answer:
shutvik [7]3 years ago
3 0

Answer:

Explanation:

def csv_sum(filename):

   total = 0

   try:

       f = open(filename)

       for line in f:

           words = line.strip().split(",")

           for word in words:

               total += float(word)

       f.close()

   except FileNotFoundError:

       pass

   return total

You might be interested in
To create nested lists within each of these topical areas that would contain links to specific pages on the AllStyles website. I
Gwar [14]

Answer:

The answer is add a new list within a list.

Explanation:

Because a nested list is a list within a list. It is the same effect of a bulleted outline in a word processing document you probably used a variety of indentations and bullet point types to denote items that were subpoints of another item in the outline.

7 0
3 years ago
3.6 Code Practice Edhesive. (PYTHON LANGUAGE)
Aleks [24]

i = 0

lst = ([])

while i < 6:

   lst.append(int(input("Enter a number: ")))

   print("Largest: "+str(max(lst)))

   i+= 1

This works for me. Best of luck.

5 0
3 years ago
For this project you have been asked to write a program for a local store owner. The store owner wants to keep a record of the n
elena55 [62]

Answer:

see explaination

Explanation:

#include <iostream>

using namespace std;

void display (string* name, double* purchase, int n)

{

cout<<"Name Purchase"<<endl;

cout<<"------------------------"<<endl<<endl;

for(int i=0;i<n;i++)

{

cout<<name[i]<<" "<<purchase[i]<<endl;

}

}

double calculate(double* purchase,int n)

{

double avg, sum=0;

for(int i=0;i<n;i++)

{

sum=sum+purchase[i];

}

avg=sum/n;

return avg;

}

int main()

{

int n;

cout<<"How many customer will you enter? "<<endl;

cin>>n;

string *name=new string[n];

double *purchase=new double[n];

for(int i=0;i<n;i++)

{

cout<<"Enter the customer"<<i+1<<"'s name: "<<endl;

cin>>name[i];

cout<<"Enter that customer's purchase: "<<endl;

cin>>purchase[i];

}

display(name, purchase,n);

double avg=calculate(purchase,n);

cout<<"Average purchase: "<<avg<<endl;

}

See attachment for the screenshot

7 0
3 years ago
You want to read about Web journals. which keywords would best help you find this information?
ololo11 [35]
The answer is (B) and (D) web or journal, <span>web Not journal


</span> Keyword is part of search engine optimization. Search engine optimization is not that heard. A keyword in a sentence is that significant word used to find info when doing your research.
Always, pick keywords that indicate main concepts of your topic. When searching, connect your keywords with Boolean values like AND, OR, and NOT





6 0
3 years ago
The best way to find out the average salary in your company is to perform a technique, known as Advanced Calibrated Sampling (AC
Setler [38]

Answer:

Agree

Explanation:

The best way to find out the average salary in your company is to perform a technique, known as Advanced Calibrated Sampling (ACS).

7 0
3 years ago
Other questions:
  • Editing and sorting the data file are steps performed during the ________ stage in the data processing cycle
    5·1 answer
  • Which of the following statements about the placement of illustrations in documents is true?
    12·1 answer
  • Create a new file that builds a shopping list from a user. There should be a input query that asks the user to list an item and
    11·1 answer
  • . Use of communications and information systems that are familiar to users is a part of which key principle? A. Security
    14·2 answers
  • What safety feature melts to protect a circuit? a. fuse b. diode c. three-prong plug d. transistor
    10·2 answers
  • Consider the following code: String word [] = {"algorithm", "boolean", "char", "double"}; for ( int i =0; i &lt; word.length/2;
    11·2 answers
  • Electrical sign connect mainly to​
    8·1 answer
  • Write a 200 word essay about how a computer is made.<br><br>Good luck.​
    9·1 answer
  • Step of opening browser on computer​
    15·1 answer
  • True or false: big data is a collection of large, complex data sets, including structured and unstructured data, which cannot be
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!