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
Which icon is greater in file size? (Show your working)
nadya68 [22]

Answer:

the 256 color icon would be greater in file size.

Explanation:

regardless of how many pixels are in the image, file A has 256 colors meaning the computer has to individually load each one of those colors. it'll probably use a lot of ink if you decide to print it, too.

5 0
3 years ago
When an interviewer asks "tell me about yourself", you should tell them about your childhood past. please select the best answer
Yanka [14]

In the interview when the candidate is asked about yourself then telling about childhood past is not correct. Therefore the given statement is false.

<h3>What is an interview?</h3>

An interview is an interaction or a conversation between an employer and the interested candidate. In the conversation the interviewee is asked about their education, family background, and work experiences.

When an interviewer ask about tell me about yourself, then the interviewee should not tell about their childhood past, rather the interviewee should give few information about their family, education, and working.

Therefore, the given statement is false.

Learn more about interview, here:

brainly.com/question/13073622

#SPJ1

7 0
2 years ago
In Microsoft Excel graphs are referred to as ______?
lbvjy [14]
D. charts hope it helps :]





6 0
3 years ago
Read 2 more answers
Who wants to trade ro^lox accounts
telo118 [61]
Make me brainlestttt please and thank you and the answer is no
8 0
3 years ago
Read 2 more answers
in demand paging, the collection of pages residing in memory that can be accessed directly without incurring a page fault is cal
slava [35]

In demand paging, the collection of pages residing in memory that can be accessed directly without incurring a page fault is called the working set.

<h3>What does demand paging mean?</h3>

Demand paging is the process of moving data from secondary storage to RAM as needed. This means that not all data is stored in main memory due to limited RAM space. So when the CPU requests a process when its page is not in RAM, it needs swapping.

<h3>What is demand paging and its benefits?</h3>

Request paging instead of loading all pages at once.Only load pages requested by running processes. With more space in main memory, more processes can be loaded, reducing resource-intensive context switch times.

Learn more about demand paging:

brainly.com/question/28902146

#SPJ4

3 0
1 year ago
Other questions:
  • Read three integers from user input. Then, print the product of those integers. Ex: If input is 2 3 5, output is 30. Note: Our s
    6·1 answer
  • It is generally safe to provide your social security number to
    7·2 answers
  • The acronym LAH stands for
    14·2 answers
  • Front wheel drive vehicles typically use​
    5·1 answer
  • Digital certificates can be used for each of these EXCEPT _____. A. to encrypt channels to provide secure communication between
    13·1 answer
  • Universal Containers uses a custom object within the product development team. Product development, executives, and System Admin
    11·1 answer
  • Fill in the blanks, so the print statement displays the result of the function call in order.
    12·1 answer
  • True or false: Concurrent validation is more time consuming to measure than predictive validation because it involves a wait per
    13·1 answer
  • The _________________ can be used to repair common causes of unbootable operating systems. It is based on the Windows Preinstall
    6·1 answer
  • which explains a method to avoid violation of personal information through phishing? do not carry around your social security ca
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!