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
(Drag each tile to the correct box)While surfing online, Patricia first checks her email and reads the latest messages. She then
Marizza181 [45]

Answer:

When Patricia checks her email use:

POP3

TCP

IP

When Patricia brows a website and log in to post a comment use:

HTTP

TCP

IP

LDAP

Explanation:

Email protocol

Patricia starts to check her email, the email application uses the protocol POP3.

The protocol TCP makes a connection with the server and transport the data.

Patricia receives her emails with the protocol IP on her computer.

Website protocol

Patricia started to surf and the protocol HTTP makes a connection with the internet.

The protocol TCP makes a connection with the server and transport the data.

With the protocol IP, she receives the website data.

With the protocol LDAP, Patricia makes a login to post the comment.

6 0
3 years ago
A=4x^2.(x-2y)-20x.(2y-x)
Luda [366]

Answer:

please give point

6 0
2 years ago
What is renewable energy
Marat540 [252]
Renewable energy is energy that is collected from renewable resources, which are naturally replenished on a human timescale, such as sunlight, wind, rain, tides, waves, and geothermal heat.
8 0
3 years ago
This is used in a program to mark the beginning or ending of a statement, or separate items in a list:_____
hammer [34]

Answer:

B) Punctuation

Explanation:

Punctuation are greatly used in different programming languages for different purposes. In the Java, C++ and C# Programming languages for example, two popular punctuation marks are the comma (,) and semi-colon (;). The comma is used for separating elements of a list and arrays, while the semi-colon indicates end of an executable statement or line of code. Other popular punctuation marks used in programming are periods (dot), question marks, parenthesis angle brackets and braces each implementing a specific grammatical syntax in the language.

5 0
3 years ago
What is a power surge?
Damm [24]
D. A spike of electricity. They are fast and have a short duration.
4 0
3 years ago
Other questions:
  • Steve wants to become a successful graphic design entrepreneur. Which entrepreneurial approach will help him succeed? A. working
    14·1 answer
  • What are the desirable qualities of a Product Vision?
    11·1 answer
  • How can you best protect yourself when using social media
    5·2 answers
  • Schools are businesses that need to install software on a large number of computers can usually obtain a ______
    13·1 answer
  • ____ is typically used with lans that have a star topology and can be used in conjunction with twisted-pair, coaxial, or fiber-o
    12·1 answer
  • What is the acronym that helps you remember the order of math operations?
    9·2 answers
  • python A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun
    15·2 answers
  • To reload a picture taken with a digital camera means to copy the digital picture from the camera to your computer.
    5·2 answers
  • Which are types of Internet connections? Choose three answers.
    5·2 answers
  • Explain different types of networking-based attacks
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!