diff --git a/solutions/armstrong_checker.py b/solutions/armstrong_checker.py index 301e46a40..a142e92f8 100644 --- a/solutions/armstrong_checker.py +++ b/solutions/armstrong_checker.py @@ -38,8 +38,5 @@ def armstrong_checker(number: int) -> str: armstrong_sum = sum(d**n for d in digits) return "True" if armstrong_sum == number else "False" -<<<<<<< HEAD # if the sum of the nth power of each digit in the number # is equal to the number, return "True", otherwise return "False" -======= ->>>>>>> 30d157832e3def89289453b26ff2fdd600bc5e6e diff --git a/solutions/copy_from_file_to_file.py b/solutions/copy_from_file_to_file.py index 79db9c938..d550d2a5f 100644 --- a/solutions/copy_from_file_to_file.py +++ b/solutions/copy_from_file_to_file.py @@ -39,15 +39,15 @@ def copy_file_to_file(source_file: str, destination_file: str) -> None: """ # Defensive checks - assert os.path.exists( - source_file - ), f"Error: Source file '{source_file}' doesn't exist." - assert source_file.endswith( - ".txt" - ), f"Error: Source file '{source_file}' is not a .txt file." - assert destination_file.endswith( - ".txt" - ), f"Error: Destination file '{destination_file}' is not a .txt file." + assert os.path.exists(source_file), ( + f"Error: Source file '{source_file}' doesn't exist." + ) + assert source_file.endswith(".txt"), ( + f"Error: Source file '{source_file}' is not a .txt file." + ) + assert destination_file.endswith(".txt"), ( + f"Error: Destination file '{destination_file}' is not a .txt file." + ) # Copy operation: Open the source file in read mode with open(source_file, "r", encoding="utf-8") as file_from: diff --git a/solutions/tests/test_fuel_gauge.py b/solutions/tests/test_fuel_gauge.py index 99bbb67a8..87f50b268 100644 --- a/solutions/tests/test_fuel_gauge.py +++ b/solutions/tests/test_fuel_gauge.py @@ -14,14 +14,9 @@ def test_full(self): self.assertEqual(fuel_gauge(90, 100), "F") def test_empty(self): -<<<<<<< HEAD """Test cases where the percentage is 10% or less it should result E.""" self.assertEqual(fuel_gauge(10, 100), "E") -======= - """Test cases where the percentage is 10% or less it should result E.""" ->>>>>>> 30d157832e3def89289453b26ff2fdd600bc5e6e - self.assertEqual(fuel_gauge(0, 100), "E") def test_percentage(self): """Test cases where the result is between 90 and 10 it should be M.""" diff --git a/solutions/word_count_from_file.py b/solutions/word_count_from_file.py index dbbd0708e..8ee100f7b 100644 --- a/solutions/word_count_from_file.py +++ b/solutions/word_count_from_file.py @@ -39,9 +39,9 @@ def word_count_txt_file(file_name) -> int: # Defensive assertions assert os.path.exists(file_name), f"Error:file '{file_name}' doesn't exist" - assert file_name.endswith( - ".txt" - ), f"Error: The file '{file_name}' does not have a .txt extension." + assert file_name.endswith(".txt"), ( + f"Error: The file '{file_name}' does not have a .txt extension." + ) # Open the file safely f = open(file_name, "r", encoding="utf-8")