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
Teenagers and their parents will never understand each other-the generation gap is too big. Its for my grade 11 English speech​
bazaltina [42]

Answer:

lol

Explanation:

lol

7 0
2 years ago
Read 2 more answers
The valid call to the function installApplication is
Zanzabum

Answer:

B. installApplication(‘A’, 1);

Explanation:

Given

The above code segment

Required

The correct call to installApplication

The function installApplication is declared as void, meaning that it is not expected to return anything.

Also, it receives a character and an integer argument.

So, the call to this function must include a character and an integer argument, in that order.

Option D is incorrect because both arguments are integer

Option C is incorrect because it passes no argument to the function.

Option A is incorrect because it receives an integer value from the function (and the function is not meant not to have a return value).

Option B is correct

8 0
3 years ago
PLLZZZZZ HELP I WILL GIVE BRAINLIEST IF ANSWER IS RIGHT
Aloiza [94]

Answer:

The answer is candyCost = int(input("How much is the candy?"))

Explanation:

3 0
3 years ago
Read 2 more answers
Select all that apply. Two physical things you can do to demonstrate you are paying attention to a speaker are _____ and _____.
omeli [17]
B and d ............
7 0
3 years ago
Read 2 more answers
What statement is accurate in regards to
lorasvet [3.4K]

The statement that is accurate in regards to sharing workbooks is that You must add the feature to the Quick Access Toolbar

<h3>What does a shared workbook implies?</h3>

The term connote the act of sharing an Excel file. Here, a person can give other users any form of access to the same document.

Sharing workbook is one that allow people to make any kinds of edits at the same time, which saves a person the trouble of keeping track of different versions.

Learn more about workbooks from

brainly.com/question/5450162

7 0
1 year ago
Other questions:
  • Checking the ___________ will reduce the possibility of having to rebuild or replace the engine.
    9·2 answers
  • T/F The two primary sections of the CPU are the arithmetic/logic unit and the control unit
    8·1 answer
  • Digital cameras always create great photographs. <br>True <br>False
    14·2 answers
  • knowledge contributes vitally to the development of __________ memory, or recollections of personally experienced events that oc
    12·1 answer
  • The function of the __________ is to on transmission assemble data into a frame, on reception disassemble frame and perform addr
    8·1 answer
  • Complete the sentence.<br> A ___ number is composed of only zeros and ones.
    8·1 answer
  • Help me asap please
    15·1 answer
  • Write is an I.P.O cycle? Describe with figure​
    5·1 answer
  • A location in memory which stores a value, the value can change as the program is running is
    12·1 answer
  • Suppose that you have the following declaration:
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!