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
The organization wants you to avoid situations that make you choose between its overall benefit and your
iren [92.7K]
Personal gain is the answer :))
3 0
3 years ago
Are Microsoft an Apple more secure from malicious action because of their closed-source approach?
omeli [17]

Yes Microsoft and Apple used the closed-source approach to better secure from malware and make to make their operating systems more user friendly.

7 0
3 years ago
What part of a resource record tells a server how long the record should remain in the cache?
V125BC [204]
Time-to-live or TTL <span>tells a server how long the record should remain in the cache.
TTL is a mechanism that limits the lifetime of data in a network or a computer and prevents data packets from circulating indefinitely.
</span><span>It also improves the caching and privacy of networks and computers.</span>
8 0
3 years ago
What area contains the command used to customize the print options in microsoft excel?
Nezavi [6.7K]
The answer is Page Layout Ribbon.  The <span>area contains the command used to customize the print options in microsoft excel is Page Layout Ribbon.</span>
4 0
3 years ago
Google is an example of a(n): Web site.search engine.search directory. subject directory
lora16 [44]
Google is famously known as a search engine and it is being used around the globe. Aside from being a search engine, it also offers other services such as productivity software or google docs, e-mail services like Gmail, cloud storage or the google drive and it also offers social networking services through google plus. Google also has some desktop application for free of use such as google chrome, picasa and instant messaging like hangouts. Their mission statement as for being the most used search engine is "to organize the world's information and make it universally accessible and useful".
6 0
3 years ago
Other questions:
  • How can I use the internet/social media to protect my identity?
    14·1 answer
  • Type the correct answer in the box spell all words correctly
    8·1 answer
  • In a relational database, the three basic operations used to develop useful sets of data are:
    10·1 answer
  • The animation industry is solely reliant on 3-D modeling and 3-D virtualization to create the animated movies in the cinemas.
    5·1 answer
  • 2. Integer plot function (find a smart way to code big integers) Write a program BigInt(n) that displays an arbitrary positive i
    8·1 answer
  • Which statement is true of Web-based social media?
    12·1 answer
  • A RISC processor has 186 total registers, with 18 global registers. There are 12 register windows, each with 10 locals. How many
    5·1 answer
  • Please answer this question​
    7·1 answer
  • A sensitive manufacturing facility has recently noticed an abnormal number of assembly-line robot failures. Upon intensive inves
    10·1 answer
  • Which of the following is ture?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!