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
Identify way computer are used in television production​
Aleonysh [2.5K]

Answer:

image editing, text om screen, weather graphics, animation, sattelites ... a lot more possibilites are endless just limited

3 0
3 years ago
Read the following scenario. How might Sarah correct successfully complete her task?
nexus9112 [7]

Answer:

Explanation:

A: To permanently remove a file from her computer, Sarah doubled-clicked on the My Computer icon and searched for her file under the “Uninstall or change a program” menu option.

or

b: empty the recycle bin : You can permanently delete a program file installed in the computer by following the procedure in option A. The option above will take you to the control panel and you'll be able to select the program you'd want to permanently remove. If you had initially deleted a file like a picture or a document or anything else that you necessarily do not need, it will go to recycle bin. You can head over there and select the Empty the Recycle Bin option to permanently delete the file.

4 0
3 years ago
1. Which utility would you use to return the common name of the computer you are at?
melamori03 [73]

The utility you would use to return the common name of the computer you are at is Ping.exe. This is the one of the utility which are in first command line utilities. It's easy, first you need to open cmd.exe then you should enter ping-your ip adress, this reveals the TCP/ICP name of the computer you are at.

5 0
4 years ago
Where can i send feedback
nata0808 [166]

Answer:

You can send f e e d b a c k to g o o g l e fe e d back

Explanation:

i Hope this helps

5 0
2 years ago
Descending selection sort with output during execution
FromTheMoon [43]

Answer:

Check the explanation

Explanation:

Please find the code down

def selection_sort_descend_trace(numbers):

i=len(numbers)

print("Output: ")

for num in range(0,i-1):# traversing from 0 to N-2, total N-1 iterations

val=numbers[num]

start=num+1

end=i

t=0

for j in range(start,end):

if(val<numbers[j]):

remember=j

val=numbers[j]

t=1

if(t==1):# swaping onlf if greater number is available

temp=numbers[num]

numbers[num]=val

numbers[remember]=temp

for p in range(i):# printing

print(numbers[p],end=' ')

print("\n")

if __name__ == "__main__":

print("Enter the integers separated by space: ")

numbers=[int(x) for x in input().split(' ')]

selection_sort_descend_trace(numbers)

Taking input as string and splitting with space as delimiter , converting the split part to integer , finally append in the list.

3 0
4 years ago
Other questions:
  • PLZ HELP ASAP!!!
    10·1 answer
  • Which letters appear in the home row on a keyboard?
    14·2 answers
  • You're setting up some VMs to test an application you're considering making available to employees of the small company you work
    13·1 answer
  • What is the term for water wave that is created by an underwater earthquake
    5·1 answer
  • A SOHO's connection to the internet is through an antenna that sends and receives a microwave signal to the ISP's antenna. There
    8·1 answer
  • Why do you think it is important to consider ethical considerations when reviewing technology and assessing the impact of partic
    9·1 answer
  • Which type of software is primarily used to organize a collection of information for easy access?
    15·1 answer
  • Select all that apply.
    9·1 answer
  • What is a graphics card?
    5·1 answer
  • Which one???????????????
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!