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
leva [86]
3 years ago
15

When a Python program is reading a file, the data is input as plain ASCII characters in a string. What is the following code doi

ng assuming a file is opened with file object inputFile? r_in = inputFile.readline() t = 0 while r_in != '': r = r_in.rstrip('\n') r_list = r.split('|') n = float(r_list[2]) t += n r_in = inputFile.readline()
Computers and Technology
1 answer:
Aleksandr [31]3 years ago
3 0

Answer:

The given python code mainly add values.

Explanation:

In the given python code, a r_in variable is defined, that reads a file in the next line, a while loop is declared, inside the loop "r_in" variable is used that provides slicing in the code.

  • In this code, in the file, each line is the format in field 1 and field 2.
  • The code puts its fields into the list first and then converts into the last dimension to the numerical type before applying to a sum.

You might be interested in
What does clicking and dragging the fill handle in excel
Olegator [25]

Answer:

The fill handle copies the same values, formulas, or fills a series of dates, texts, numbers, and other data to a desired number of cells. ... Click and hold the handle, then you can drag up, down, across over other cells. When you release your mouse button, it auto-fills the content to the cells you dragged over.

5 0
2 years ago
What's the purpose of IP
Slav-nsk [51]

Thank you for this question. The answer is that an Ip adress stands fo Internet Protocol which acts like a home adress. Bascily it helps you find a node in a network as the IP adress is made of letters and numbers separated by a full stop. I hope you are happy

4 0
3 years ago
Read 2 more answers
James would like to send a document he has saved on the hard drive to coworkers and Ireland Brazil and India. These coworkers ha
frozen [14]
Email the document to them ?

8 0
3 years ago
Read 2 more answers
The five types of personal computers are: desktops, laptops, tablets, smartphones, and ________.
motikmotik

Answer:

B. Wearables.

Explanation:

These are tagged to be a category now in the technology as they are seen to make up the fifth type of personal computers in the question above. These are seen to be attached on the body or sometimes embedded to our outfit and also in other cases hung on a part of our body. They are counted to range from fitness trackers to smart watches, headsets etc. They are said to posses microprocessors which aid their functional ability through its use of the internet.

4 0
3 years ago
What is the default extension of Q Basic program file? ​
KonstantinChe [14]

Answer:

Bas

Files written with QBASIC must be run using the program and have the "bas" file extension.

Hope this helps

#Carryonlearning

8 0
2 years ago
Other questions:
  • Computers spend most of their time in loops, so multiple loop itera- tions are great places to speculatively find more work to k
    10·1 answer
  • If a filesystem has a block size of 4096 bytes, this means that a file comprised of only one byte will still use 4096 bytes of s
    12·1 answer
  • Suppose you want to delete an existing file from within Word. What would you do? A. Click on the File button, choose Recent, ope
    9·1 answer
  • If a storm is 7.5 kilometers away, how much time is expected between observations of lightning and thunder? Round your answer to
    10·1 answer
  • What lie does E.D. tell to keep the musical from being canceled? There is a television crew coming to do a story on it. Jake wil
    6·1 answer
  • Commands are organized into tabs on the
    8·2 answers
  • Define a constructor as indicated. Sample output for below program:Year: 0, VIN: -1Year: 2009, VIN: 444555666// ===== Code from
    8·1 answer
  • What’s an example of software?
    6·2 answers
  • If you Buy my group clothing in R.o.b.l.o.x for a donation i will make you brainliest
    14·2 answers
  • What do you call the quality of information
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!