This commit is contained in:
Pawel Felcyn 2023-12-11 14:31:09 +01:00
parent c40716abe8
commit f3924b4961

14
TaskD04/run.py Normal file
View File

@ -0,0 +1,14 @@
import re
import os
def find_digits(file_path):
with open(file_path, 'r', encoding='utf-8') as file:
txt = file.read()
pattern = re.compile(r'\d+')
return pattern.findall(txt)
path = os.path.join(os.path.dirname(__file__), 'simple.in')
matches = find_digits(path)
print(matches)