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
Energía de movimiento de los átomos o moléculas
olasank [31]

Answer:

g

Explanation:

4 0
2 years ago
If myClass has a constructor with a parameter of type String, select the other constructor that should be included.
JulijaS [17]

Answer:

d. public myClass( ) {. . .}

Explanation:

A constructor is a special method that is called when an object of a class is created. It is also used to initialize the instance variables of the given class. A class may have one or more constructors provided that these constructors have different signatures. A class that does not have a constructor explicitly defined has a default parameterless constructor.

Having said these about a constructor, a few other things are worth to be noted by a constructor.

i. In Java, a constructor has the same name as the name of its class.

For example, in the given class <em>myClass</em>, the constructor(s) should also have the name <em>myClass</em>.

ii. A constructor does not have a return value. It is therefore wrong to write a constructor like this:

<em>public void myClass(){...}</em>

This makes option a incorrect.

iii. When a constructor with parameters is defined, the default parameterless constructor is overridden. This might break the code if some other parts  of the program depend on this constructor. So it is advisable to always explicitly write the default parameterless constructor.

This makes option d a correct option.

Other options b and c may also be correct but there is no additional information in the question to help establish or justify that.

7 0
3 years ago
Daphne has determined that she has malware on her linux machine. She prefers to only use open-source software. Which anti-malwar
Llana [10]

Answer:

ClamAV is the open source antivirus you can in your Linux machine.

5 0
2 years ago
Please
Andrew [12]

Answer:

C. 2^16

Explanation:

In Computer Networking, there are five (5) classes of IP addresses, these include;

- Class A

- Class B

- Class C

- Class D

- Class E

The various classes of IP address are represented by the value of their first octet. The first octet value of Class B is 128-191 with a subnet mask of 16.

Hence, from the IP address 149.130.x.y where x and y are 8-bit numbers. The x and y equals 16-bit numbers.

Thus, 2^16 devices can connect to the Wellesley network before we run out of IP addresses.

3 0
3 years ago
A taxi cab costs $1.25 for the first mile and $0.25 for each additional mile. Write an
Mumz [18]

Answer:

0.25x+1.25=8

Explanation:

Hope this helps

3 0
2 years ago
Other questions:
  • A computer has a pipeline with four stages. each stage takes the same time to do its work, namely, 1 nsec. how many instructions
    5·2 answers
  • A(n application system is the master controller for all the activities that take place within a computer system. _______________
    15·1 answer
  • Which one of these tasks best describes the process of localization?
    12·1 answer
  • Know when the double, int, String, and char data types are best used. Example: I would store a social security number in a strin
    7·1 answer
  • In his article “is google making up stupid” Nicholas Carr uses a metaphor to suggest that
    11·2 answers
  • How do I logout of Brainly on mobile? When I went to settings, it had the option to log out but it was grayed out.
    14·1 answer
  • _____________________ denotes the use of human interactions to gain any kind of desired access. Most often, this term involves e
    11·1 answer
  • Of the following field which would be the most appropriate for the primary key in a customer information table?
    5·1 answer
  • What is the result of the following code?<br><br> x=7//2+10%2**4<br><br> print(x)
    15·1 answer
  • You can use the___<br> to copy data from Excel to Access.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!