From a4b5bcbf899e3560952c117209a5fb2337ae63f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zar=C4=99ba?= Date: Fri, 6 Dec 2024 11:29:05 +0100 Subject: [PATCH] fix pebkac --- TaskA02/solution.py | 15 --------------- TaskA04/solution.py | 25 ------------------------- skrypcik.py | 0 3 files changed, 40 deletions(-) delete mode 100644 TaskA02/solution.py delete mode 100644 TaskA04/solution.py delete mode 100644 skrypcik.py diff --git a/TaskA02/solution.py b/TaskA02/solution.py deleted file mode 100644 index b96a05b..0000000 --- a/TaskA02/solution.py +++ /dev/null @@ -1,15 +0,0 @@ -# File path to read -file_path = 'text.txt' - -# Open the file and search for lines containing the word "pies" -with open(file_path, 'r') as file: - lines_with_pies = [] - for line in file: - # Split the line into words and check for the word "pies" (case-insensitive) - words = line.strip().lower().split() - if 'pies' in words: - lines_with_pies.append(line.strip()) - -# Display the results -for line in lines_with_pies: - print(line) \ No newline at end of file diff --git a/TaskA04/solution.py b/TaskA04/solution.py deleted file mode 100644 index 3d76ef9..0000000 --- a/TaskA04/solution.py +++ /dev/null @@ -1,25 +0,0 @@ -# File path to read -file_path = 'text.txt' - -# List to store all digit substrings -digit_substrings = [] - -# Open the file and read line by line -with open(file_path, 'r') as file: - for line in file: - current_digits = "" - # Loop through each character in the line - for char in line: - if char.isdigit(): # Check if the character is a digit - current_digits += char # Add to current digit substring - else: - if current_digits: # End of a digit substring - digit_substrings.append(current_digits) - current_digits = "" # Reset current_digits for next substring - - # Append any remaining digits at the end of the line - if current_digits: - digit_substrings.append(current_digits) - -# Print the result as space-separated substrings -print(" ".join(digit_substrings)) \ No newline at end of file diff --git a/skrypcik.py b/skrypcik.py deleted file mode 100644 index e69de29..0000000