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
Marianna [84]
3 years ago
8

Write a shell (text-based) program, called sum_second.py, that opens a text file called stuff.txt with 2 numbers per line separa

ted by commas and prints out the sum of the second numbers on every line. For example, if stuff.txt has the following lines: 500,55 300,45 200,7 400,20 Then the following example output would happen. PS C:\Users\ssiva\Desktop> python sum_second.py Sum: 127 PS C:\Users\ssiva\Desktop>

Computers and Technology
1 answer:
Ivanshal [37]3 years ago
6 0

Answer:

See explaination for the program code

Explanation:

The Programming code:

inFile = open("stuff.txt", "r")

num = []

Sum = 0

for val in inFile.readlines():

value = val.split(",")

Sum = Sum + int(value[1])

print("Sum of second number on every line in the file is: ", Sum)

inFile.close()

Please kindly check attachment for output

You might be interested in
Which transformation(s) can be used to map ARST onto
xenn [34]

Answer:

The last line i.e "rotation, then translation​ " is the correct answer .

Explanation:

Missing information :

In this question some information is missing The triangles are congruent by the SSS and HL. This line is missing in the given question .

The triangles that are the exactly similar sides and the angles.is known as congruent triangles .In the congruent  triangle  One's three sides are exactly similar in way of measuring to someone else's three sides also each of the three angles has almost the same angle as another.

  • In the congruent triangles firstly the reflection will applied then after the translation process is applied in the SSS and HL.
  • The other options are incorrect because they are not used for the mapping of RST into AWWX that's why these are incorrect option .  
6 0
3 years ago
Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending whe
dalvyx [7]

Answer:

string=""

while string not in {"Quit","quit","q"}:

   string=input("Enter line to be reversed")   #line of text will be entered

   if string!="Quit" and string!="quit" and string!="q":    #If quit is not  entered

       print("Reverse of line is : ")

       print(string[::-1])

OUTPUT :

Enter line to be reversedThis code is in python language

Reverse of line is :  

egaugnal nohtyp ni si edoc sihT

Enter line to be reversedHello world

Reverse of line is :  

dlrow olleH

Enter line to be reversedquit

Explanation:In the above program, First a while loop is executed and checked if line of text is not 'quit', 'Quit' or 'q'. If condition is true, then loop is executed and in python any string or list can be traversed from end if step is given -1. Similarly line of text is accessed from the last element. If quit is entered, then the program will be broken out of the loop.

7 0
3 years ago
I WILL GIVE BRAINLIST THING TO WHOEVER GIVES ME THE CORRECT ANSWER
Anna11 [10]

Answer:

Evaluate and compare free and commercial versions of the antivirus software provided at the link above. Based on the information you learned in this Unit, what differences, if any, are significant enough to warrant considering paying for the software versus using the free version (for a typical home user, if the specific annual costs were not a major consideration)? What is “missing” from the personal/home/base level subscription that you might want?

Explanation:

4 0
3 years ago
During boom times, which of the
pashok25 [27]
I think the answer is D.
3 0
3 years ago
A search engine displays a list of webpage names that contain the search text. what is the term for that list?
Minchanka [31]
<span>A search engine displays a list of webpage names that contain the search text. The term for that list is hit.
Basically, what this term refers to is the number of visits, or a number of downloads that happened on that particular webpage. It is a good tool to measure web traffic, or how much that page is visited.
</span>
6 0
3 years ago
Other questions:
  • Given a floating point variable fraction, write a statement that displays the value of fraction on the screen. Do not display an
    13·1 answer
  • What development in operating systems happened between the years 1990 and 2000?
    15·1 answer
  • How often does colleges update the cost of attendance on their website?.
    13·1 answer
  • Which is the first thing that would happen if a plant could NOT obtain carbon dioxide? A It would not be able to reproduce. B It
    5·1 answer
  • 2.
    8·1 answer
  • A student will not be allowed to sit in exam if his/her attendance is less than 75% .
    8·1 answer
  • 3. Choose the statement that best describes a ray. A ray extends forever in both directions. B ray is a part of a line with two
    10·1 answer
  • What are some ways you can give staying off your phone a "boost" and make it easier to do?
    9·1 answer
  • Help please match them if you just put a link or say “I don’t know but thanks for the points” I’ll report your answer and you wo
    10·1 answer
  • How do people and computers approach problems differently
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!