pobranie danych dla 4, rozwiazanie dziala

This commit is contained in:
LuminoX 2024-11-14 20:30:48 +01:00
parent c8de88b936
commit 0beb5c2db5
2 changed files with 50025 additions and 1 deletions

File diff suppressed because one or more lines are too long

25
TaskA04/task4.py Normal file
View File

@ -0,0 +1,25 @@
with open('polish_wiki_excerpt.in', encoding='utf8') as f:
lines = f.readlines()
for line in lines:
line = line.strip()
subdigits = []
pom = ''
for char in line:
if char.isdigit():
pom += char
elif pom != '':
subdigits.append(pom)
pom = ''
else:
pass
if pom.isdigit():
subdigits.append(pom)
if len(subdigits) > 0:
finalLine = ' '.join(subdigits)
print(finalLine)