with open("t.txt", "r") as input_file:
with open("cif.txt", "w") as cif_file:
with open("other.txt", "w") as other_file:
for line in input_file:
for char in line:
if char.isdigit():
cif_file.write(char)
else:
other_file.write(char)
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
with open("t.txt", "r") as input_file:
with open("cif.txt", "w") as cif_file:
with open("other.txt", "w") as other_file:
for line in input_file:
for char in line:
if char.isdigit():
cif_file.write(char)
else:
other_file.write(char)