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)
Step-by-step 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.