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
lara [203]
3 years ago
10

Write a program that reads a file that contains only integers, but some of the integers have embedded commas, as in 145,020. The

program should copy the information to a new file, removing any commas from the information. Do not change the number of values per line in the file.
Computers and Technology
1 answer:
PtichkaEL [24]3 years ago
4 0

Answer:

with open("integer_file.txt", "r") as file:

   book = file.read().strip()

   pages = book.split(" ")

   for page in pages:

       if "," in page:

           comma_rm = page.replace(",","")

           print(comma_rm)

       else:

           print(page)

Explanation:

The python program opens a text file (Assuming the file contains only integers but are in string form eg: 5 in '5' for string), reads the whole content of the file as a string, splits it to a list of strings and iterates through to remove commas in the number string and display the elements.

You might be interested in
A hard drive with a spin speed of 7200 RPM, commences spinning at time = 0, at time = 1.326 ms what is the angle that the disk h
Flura [38]

Answer: I. 57º 17'   II. 1 rad.

Explanation:

A spin speed, implies the relationship between the angle rotated and the time  that has been spinning, which is equal, by definition, to the angular velocity.

ω = Δ∅ / Δt

In order to get the angle rotated in degrees, we need to convert first from RPM (revolutions per minute) to º/sec, as follows:

7200 rev/min *( 1 min/60 sec)* (360º/ 1 rev) = 7200* 6= 43200 º/s

Now, we know that the time passed since it started to spin, was 1.326 msec, i.e., 0.001326 sec.

Remembering that  ω = Δ∅ / Δt, solving for Δ∅, we get:

Δ∅ = 43200 º /s * 0.001326 sec = 57º 17'

II. In order to get the answer in rads, we can convert the rpm to rads/sec, as follows:

7200 rev/min *( 1 min/60 sec)* (2 π/ 1 rev) = 240 π rad/sec.

Applying the same equation as above, we get:

Δ∅ = 240 π rad/s * 0.001326 sec = 1 rad.

7 0
4 years ago
Which customers are typical for the Argriculture,Food, and Natural Resources career cluster?
Ahat [919]

Ecosystem developers

8 0
4 years ago
VLSI is the process of creating an integrated circuit (IC) by combing thousands of transistors into a single chip. There are two
stepan [7]

Answer:

Explanation:

An FPGA is a field programmable gate array. It could be "programmed" to do certain task, but don't mistake it with a microprocessor. When programming an FPGA, you're actually changing it's physical structure, the logic gates inside the FPGA, to do the task for you. Therefore, unlike a microprocessor which has to run through a series of command, an FPGA could be rewired to run at a much faster and more efficient rate.

FPGA is good for testbenching and are budget friendly since they can be reprogrammed over and over again in case you messed up. However, they can be quite big and bulky, so they are not suitable for mass production.

ASIC in the other hand can be compact to a small size. ASIC are pretty much the IC chips that you use, like your Intel CPU or LM7000 series chips. However, the process of making them that small is irreversible, so if you messed up, you gotta throw away the whole batch. This make them expensive to make, but their small size and production process allows them to be made in bulk.

Both FPGA and ASIC are good for power consumption and speed because you're actually designing their physical circuit layout, so if your design is efficient then the product will be efficient in both speed and power as well.

In Summary, you design and test your circuit using an FPGA first. Then you send that design to a production company and they will use that design to mass produce it as a small chip.

5 0
4 years ago
If you're currently using text, display, and video ads but also want to more specifically control spending on ads that appear wh
zhenek [66]

Answer:a)Search Network

Explanation:Search network is the tool provided by Google where the advertisements appear when there is search execute on the website or apps.The ad appears while searching is due to the keywords present in the search titles.

Other options are incorrect because display network is already taken by the user and because of that display, text and video are being accessed and Universal app contain various features which is not required in this situation.Search network along with display opt-in is not correct because it already has display network. Thus the correct option is option(a).

5 0
3 years ago
Software that function as an electronic file cabinet
Airida [17]

Answer:

The answer to this question is "Document management software".

Explanation:

Document management software is software that provides a facility to stores data in an organized manner. It manages and tracks its electronic documents.

  • This software controls many fields, that are Storage location, Security and access control, Version control, etc.
  • It is a common component, that is found in an Enterprise Content Management environment, that uses this software.

7 0
3 years ago
Other questions:
  • Are sql injections legal?
    15·1 answer
  • When you are duplicating an object, what does the Rows field number tell you?
    10·1 answer
  • 1. Consider the following code segment.
    8·1 answer
  • Crop marks are used on an illustration to indicate to the printer the
    10·1 answer
  • In python:
    14·1 answer
  • Match the ocean floor feature with its characteristic.
    6·1 answer
  • DJ Davon is making a playlist for an internet radio show; he is trying to decide what 1212 songs to play and in what order they
    12·1 answer
  • Your Google Search text ad has three main components. The first is a headline, and the second is a description. What's the third
    14·1 answer
  • provides an automated method for discovering host systems on a network. Although it doesn't necessarily discover all weaknesses,
    11·1 answer
  • Im drinking coffee. and working on school and watching a show. Whos with me?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!