forked from miczar1/djfz-24_25
pobranie danych dla 4, rozwiazanie dziala
This commit is contained in:
parent
c8de88b936
commit
0beb5c2db5
File diff suppressed because one or more lines are too long
25
TaskA04/task4.py
Normal file
25
TaskA04/task4.py
Normal 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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user