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
What is an example of a dedicated computer system?
Maslowich
Database server - computer dedicated to databases
Hope this helped
5 0
4 years ago
Read 2 more answers
I need some good roblox games suggestions. Since brainly only lets two answer, please answer in the commments. :)
3241004551 [841]

Answer: Phantom Forces... I think that is what it is called...

4 0
3 years ago
Read 2 more answers
When the CSS property of position is set to ____ it moves the element relative to its original position and allows other element
Anvisha [2.4K]

Answer: Absolute

Explanation: The Cascading Style Sheet is used to describe the style of a Hypertext Markup Language document. The cascading style sheet has different property value for setting the position of elements. When the property value to absolute, it moves the element relative to its original position and allows other elements to flow into the space that the absolutely positioned element would have otherwise occupied. Element is relative to browser window when set to fixed. Element is positioned relative to its original position when property value is set to relative.

7 0
3 years ago
If an LED had power rating of 150 milliwatts at 1.5 volts , how much current is used
Lana71 [14]

The relation between Power, Current and Voltage is given as:

      P = V i

where P is Power in Watts,

V is Voltage in Volts,

and i is Current in Ampere.


We are given:

Power = 150 milliwatts = 0.15 Watts

(as 1 milliwatt = 0.001 Watts)

Voltage = 1.5 volts

and we need to find the current.


Hence using above equation:

P = V i

i = \frac{P}{V}

i = \frac{0.15}{1.5}

i= 0.1 Ampere


Answer:

The current used is 0.1 Ampere

8 0
3 years ago
A business would use a website analytics tool for all of the following EXCEPT _____.
BaLLatris [955]

Answer:

C. viewing why someone visited your webpage

Explanation:

Website analysis often referred to as Web analytics is a term that is used to describe a form of website distribution, activity, and proportion relating to its performance and functionality.

Some of the things Web analytics does include the following:

1.  measures the number of pages a user or visitor viewed or assessed

2.  counts the number of new and returning visitors

3.  helps website administrator to know when to increase bandwidth

Hence, in this case, the correct answer is option C. viewing why someone visited your webpage

4 0
3 years ago
Other questions:
  • I can't see the answer
    13·2 answers
  • Is October tornado season?
    8·2 answers
  • why backupdocs.com keeps giving computer system update with regards to pdf documents savings? #backupdocuments
    6·1 answer
  • The actual database of Active Directory shared resources is stored on one or more computers designated as:
    6·1 answer
  • Select all reasons it is important to perform equipment maintenance
    8·1 answer
  • Https://www.bing.com/videos/search?q=dancing+aaron+smith+1+hour&view=detail&mid=C6C28AF3C0CEC1E4AEE3C6C28AF3C0CEC1E4AEE3
    14·1 answer
  • You decided to upgrade your PC with a faster processor. To do this, you ordered a new motherboard over the Internet that support
    10·1 answer
  • This code --> plt.plot(x,y) is used to draw :
    8·1 answer
  • You are given an integer N where 0 <= N <= 100, followed by another line of input which has a word W with length L where 1
    6·1 answer
  • During which phase of system development would you acquire any necessary hardware and software?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!