diff --git a/task_061021/array_output.txt b/task_061021/array_output.txt deleted file mode 100644 index ac7aa473..00000000 --- a/task_061021/array_output.txt +++ /dev/null @@ -1,61 +0,0 @@ -Line 168 - Chapter 1 -Line 294 - Chapter 2 -Line 404 - Chapter 3 -Line 590 - Chapter 4 -Line 712 - Chapter 5 -Line 832 - Chapter 6 -Line 1120 - Chapter 7 -Line 1369 - Chapter 8 -Line 1634 - Chapter 9 -Line 1850 - Chapter 10 -Line 2147 - Chapter 11 -Line 2345 - Chapter 12 -Line 2421 - Chapter 13 -Line 2616 - Chapter 14 -Line 2747 - Chapter 15 -Line 2926 - Chapter 16 -Line 3315 - Chapter 17 -Line 3454 - Chapter 18 -Line 4023 - Chapter 19 -Line 4227 - Chapter 20 -Line 4424 - Chapter 21 -Line 4651 - Chapter 22 -Line 4840 - Chapter 23 -Line 5029 - Chapter 24 -Line 5247 - Chapter 25 -Line 5415 - Chapter 26 -Line 5663 - Chapter 27 -Line 5818 - Chapter 28 -Line 5980 - Chapter 29 -Line 6264 - Chapter 30 -Line 6398 - Chapter 31 -Line 6584 - Chapter 32 -Line 6765 - Chapter 33 -Line 6993 - Chapter 34 -Line 7230 - Chapter 35 -Line 7524 - Chapter 36 -Line 7733 - Chapter 37 -Line 7889 - Chapter 38 -Line 8013 - Chapter 39 -Line 8193 - Chapter 40 -Line 8393 - Chapter 41 -Line 8666 - Chapter 42 -Line 8865 - Chapter 43 -Line 9412 - Chapter 44 -Line 9652 - Chapter 45 -Line 9843 - Chapter 46 -Line 10157 - Chapter 47 -Line 10619 - Chapter 48 -Line 10872 - Chapter 49 -Line 11150 - Chapter 50 -Line 11387 - Chapter 51 -Line 11617 - Chapter 52 -Line 11960 - Chapter 53 -Line 12305 - Chapter 54 -Line 12504 - Chapter 55 -Line 12792 - Chapter 56 -Line 13145 - Chapter 57 -Line 13337 - Chapter 58 -Line 13622 - Chapter 59 -Line 13907 - Chapter 60 -Line 14093 - Chapter 61 diff --git a/task_061021/kcgulis_061021.py b/task_061021/kcgulis_061021.py index 7d5736e7..5709679a 100644 --- a/task_061021/kcgulis_061021.py +++ b/task_061021/kcgulis_061021.py @@ -7,20 +7,20 @@ CHAPTERS = 61 def read_array(document): with open(document, encoding='utf-8') as book: lines = [line.strip('\n') for line in book] # removes 'enter' characters - with open('array_output.txt', 'w') as output: - for i in range(1, CHAPTERS + 1): - line = lines.index(f"Chapter {i}") + 1 # finds all chapter indexes/lines - output.write(f"Line {line} - Chapter {i}\n") # writes line in file + with open('array_output.txt', 'w') as output: + for i in range(1, CHAPTERS + 1): + line = lines.index(f"Chapter {i}") + 1 # finds all chapter indexes/lines + output.write(f"Line {line} - Chapter {i}\n") # writes line in file def read_string(document): import re with open(document, encoding='utf-8') as book: lines = book.read() - with open('str_output.txt', 'w') as output: - for i in range(1, CHAPTERS + 1): - _, position = re.finditer(rf"\bChapter {i}\b", lines) # finds all chapter positions - output.write(f"Position {position.start()} - Chapter {i}\n") # writes position in file + with open('str_output.txt', 'w') as output: + for i in range(1, CHAPTERS + 1): + _, position = re.finditer(rf"\bChapter {i}\b", lines) # finds all chapter positions + output.write(f"Position {position.start()} - Chapter {i}\n") # writes position in file def main(): diff --git a/task_061021/str_output.txt b/task_061021/str_output.txt deleted file mode 100644 index e69de29b..00000000