From 2701f54b972eeb913e5c4e5c3d92eb6affece8ba Mon Sep 17 00:00:00 2001 From: umairsafdar768 Date: Thu, 22 Aug 2024 16:22:23 +0500 Subject: [PATCH 1/3] 14th commit --- additional_func.py | 24 ------------------------ main.py | 38 +++++++++++++++++++------------------- 2 files changed, 19 insertions(+), 43 deletions(-) delete mode 100644 additional_func.py diff --git a/additional_func.py b/additional_func.py deleted file mode 100644 index 63dbacd..0000000 --- a/additional_func.py +++ /dev/null @@ -1,24 +0,0 @@ -def reverse_string(s): - """ - Reverse a given string - """ - return s[::-1] - -def is_palindrome(s): - # Remove non-alphanumeric characters and convert to lowercase - cleaned = ''.join(char.lower() for char in s if char.isalnum()) - # Compare the cleaned string with its reverse - return cleaned == cleaned[::-1] - -def celsius_to_fahrenheit(celsius): - """ - Convert Celsius to Fahrenheit - """ - return (celsius * 9/5) + 32 -## -def count_vowels(string): - """ - Count the number of vowels in a string - """ - vowels = 'aeiouAEIOU' - return sum(1 for char in string if char in vowels) \ No newline at end of file diff --git a/main.py b/main.py index a45e964..dd81f20 100644 --- a/main.py +++ b/main.py @@ -85,22 +85,22 @@ def fibonacci(n): # New functions added without test cases(2) -def celsius_to_fahrenheit(celsius): - """ - Convert Celsius to Fahrenheit - """ - return (celsius * 9/5) + 32 - -def count_vowels(string): - """ - Count the number of vowels in a string - """ - vowels = 'aeiouAEIOU' - return sum(1 for char in string if char in vowels) - -def is_palindrome(s): - """ - Check if a string is a palindrome - """ - s = ''.join(char.lower() for char in s if char.isalnum()) - return s == s[::-1] \ No newline at end of file +# def celsius_to_fahrenheit(celsius): +# """ +# Convert Celsius to Fahrenheit +# """ +# return (celsius * 9/5) + 32 + +# def count_vowels(string): +# """ +# Count the number of vowels in a string +# """ +# vowels = 'aeiouAEIOU' +# return sum(1 for char in string if char in vowels) + +# def is_palindrome(s): +# """ +# Check if a string is a palindrome +# """ +# s = ''.join(char.lower() for char in s if char.isalnum()) +# return s == s[::-1] \ No newline at end of file From 25586cf89a9c4669feb0a05f41d2b38ddc615278 Mon Sep 17 00:00:00 2001 From: umairsafdar768 Date: Thu, 22 Aug 2024 16:23:39 +0500 Subject: [PATCH 2/3] 15th commit --- test_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_test.py b/test_test.py index 7706546..96877ba 100644 --- a/test_test.py +++ b/test_test.py @@ -1,6 +1,6 @@ import pytest from main import Calculator, Greeter, factorial, is_prime, fibonacci -from additional_func import celsius_to_fahrenheit, count_vowels +#from additional_func import celsius_to_fahrenheit, count_vowels def test_calculator_add(): calc = Calculator() From 30ad69499b998316cf5930220209e8a3ef953a0b Mon Sep 17 00:00:00 2001 From: umairsafdar768 Date: Thu, 22 Aug 2024 16:25:09 +0500 Subject: [PATCH 3/3] 16th commit --- test_test.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test_test.py b/test_test.py index 96877ba..22b86dc 100644 --- a/test_test.py +++ b/test_test.py @@ -90,18 +90,18 @@ def test_fibonacci_edge_cases(): assert fibonacci(4) == [0, 1, 1, 2] #from 2nd file -def test_celsius_to_fahrenheit(): - assert celsius_to_fahrenheit(0) == 32 - assert celsius_to_fahrenheit(100) == 212 - assert celsius_to_fahrenheit(-40) == -40 - assert round(celsius_to_fahrenheit(37), 2) == 98.60 - -def test_count_vowels(): - assert count_vowels("hello") == 2 - assert count_vowels("AEIOU") == 5 - assert count_vowels("rhythm") == 0 - assert count_vowels("The quick brown fox") == 5 - assert count_vowels("") == 0 +# def test_celsius_to_fahrenheit(): +# assert celsius_to_fahrenheit(0) == 32 +# assert celsius_to_fahrenheit(100) == 212 +# assert celsius_to_fahrenheit(-40) == -40 +# assert round(celsius_to_fahrenheit(37), 2) == 98.60 + +# def test_count_vowels(): +# assert count_vowels("hello") == 2 +# assert count_vowels("AEIOU") == 5 +# assert count_vowels("rhythm") == 0 +# assert count_vowels("The quick brown fox") == 5 +# assert count_vowels("") == 0 if __name__ == "__main__": pytest.main() \ No newline at end of file