17 lines
432 B
Python
17 lines
432 B
Python
|
import re
|
||
|
|
||
|
def delete(file_path):
|
||
|
digit_pattern = r'\d+'
|
||
|
|
||
|
with open(file_path, 'r', encoding='utf-8') as file:
|
||
|
for line in file:
|
||
|
matches = list(re.finditer(digit_pattern, line))
|
||
|
|
||
|
if len(matches) >= 2:
|
||
|
start, end = matches[1].span()
|
||
|
line = line[:start] + line[end:]
|
||
|
|
||
|
print(line, end='')
|
||
|
|
||
|
file_path = 'TaskF04/simple.in'
|
||
|
delete(file_path)
|