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]
2 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]2 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
What would you do if you experienced academic frustrations in school? Check all that apply.
kipiarov [429]
I think it is all of them :))
6 0
3 years ago
Read 2 more answers
What happens when a user clicks Accept on a meeting request?
melomori [17]

Explanation:

Other events at that time are canceled, and the meeting cannot be canceled by the organizer.

The agenda is updated with the user’s contact information, and other events at that time are canceled.

The meeting cannot be canceled by the organizer, and the agenda is updated with the user’s contact information.

The meeting organizer is notified, and a copy of the meeting is added to the user’s Outlook calendar.

3 0
3 years ago
Read 2 more answers
Shop anywhere. Snap every receipt. Earn FREE gift cards! Sign up for Fetch with my code "DUEUY" and get 2,000 points when you sn
katovenus [111]

Answer:

mk

Explanation:

i think its DUEUY

4 0
3 years ago
1. what do to call the process of preserving food by soaking the raw ingredient in salt and water solution.
garri49 [273]

Answer:

Salting is the preservation of food with dry edible salt. It is related to pickling in general and more specifically to brining also known as fermenting (preparing food with brine, that is, salty water) and is one form of curing.

Explanation:

5 0
3 years ago
According to the video, what is the goal of Film and Video Editors?
Eddi Din [679]

Answer:

To maintain their Skills

Explanation:

The main job of video editor and film editor is to gather the raw material related to some particular topic that is provided by camera person. With the help of skills the video editor convert that raw video into finished product that will be able to broadcast.

That is the reason, he should maintain his skills to preform the video editing task accurately.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Rachel works in a bank. She wants to present the idea of implementing an IS to the management. How should Rachel describe the IS
    9·2 answers
  • Which of the following devices is used to connect a computer to a network
    7·1 answer
  • Which are factors that go into a project plan? choose four answers
    14·1 answer
  • What game is this? help mee?
    8·2 answers
  • What is the ghosted text or picture behind the content on the page?​
    6·1 answer
  • Which of the following is not a method for opening Word software?
    14·2 answers
  • GIVING BRAINLIEST
    15·1 answer
  • The page that appears when you first open your Internet browser is the _____.
    8·1 answer
  • Which of the following is an example of machine learning?
    5·1 answer
  • (Synchronized threads) Write a program that launches 1000 threads. Each thread adds a random integer (ranging from 1 to 3, inclu
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!