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
In addition to librarians, what other type of worker would you expect to find employed in a school or library
diamong [38]
In a school or library you can find a managor or boss

3 0
4 years ago
Read 2 more answers
PLEASE HELP ME! Sam was researching rocks and minerals. He thought the Web site looked unprofessional, so he looked for the auth
tiny-mole [99]

Answer:

B

Explanation:

If a site looks unprofessional and doesn't have any credentials, those are two signs that it's probably not very reliable.

7 0
3 years ago
In procedural programming, where does the flow of control usually route from the main function?
Zinaida [17]

Answer:

Subroutine or called function.

Explanation:

Procedural programming is a programming techniques of creating modular divisions between lines of code, with a provision to call and run a block of code at any given instance in the program.

A program flow control breaks at will from the main function to a target defined function or subroutine, which returns a value back to the normal flow of the program. It uses conditional and loop statement to achieve its task.

6 0
3 years ago
List any four e-commerce website​
Ipatiy [6.2K]

Answer:

Amazon. Founded in the US in 1994, Amazon started as an online bookstore that later diversified to products including media, electronics, apparel, furniture, food, toys, and jewelry.

eBay. ...

Walmart. ...

Etsy. ...

Home Depot. ...

Target. ...

Best Buy. ...

Wayfair.

5 0
3 years ago
Read 2 more answers
Forwarded events can only be recorded when systems ADMINISTRATORS have de-established an event subscription. TRUE or FALSE
weeeeeb [17]

Answer:

True

Explanation:

Forwarded events can only be recorded when systems administrators have de-established an event subscription.

8 0
3 years ago
Other questions:
  • What is the definition of the components that motherboards, ssds, processors, and cases are part of?
    10·1 answer
  • 1. (8 pts) Write an application that is including a three-question multiple choice quiz about Java programming language. Each qu
    8·1 answer
  • When you use file explorer or windows explorer to delete a file from the hard drive, where does windows put the file?
    11·1 answer
  • Which actions can be performed on tables in Word? Check all that apply.
    13·2 answers
  • What is a palindrome?
    13·1 answer
  • What function is the responsibility of the network layer?
    10·1 answer
  • Compare and contrast fair use to copyright.
    5·1 answer
  • The order of precedence determine
    10·1 answer
  • How many feet are in 69 inches
    15·1 answer
  • Which of the following is NOT a font style? Color Bold Italic Regular
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!