diff --git a/.vscode/settings.json b/.vscode/settings.json index 252022b48..47890f098 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,7 @@ //-------- Editor configuration -------- // Controls auto save of editors that have unsaved changes.: https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save - "files.autoSave": "onFocusChange", + "files.autoSave": "off", // Format a file on save. A formatter must be available. "editor.formatOnSave": true, @@ -122,5 +122,8 @@ "source.fixAll.ruff": "explicit", "source.organizeImports.ruff": "explicit" } - } + }, + "cSpell.words": [ + "Mayar" + ] } diff --git a/collaboration/README.md b/collaboration/README.md index 20889b951..64a2ebba7 100644 --- a/collaboration/README.md +++ b/collaboration/README.md @@ -1,5 +1,40 @@ # Collaboration +## The summary + +Our group is committed to fostering trust, collaboration, and open communication + by valuing diverse perspectives, respecting + time, and embracing accountability. We aim to create a positive and inclusive + environment where everyone feels supported, empowered to contribute, and aligned + toward shared goals. We strive to build strong relationships and ensure + collective growth where mistakes are treated as learning opportunities, and + trust is rebuilt through consistent actions and open dialogue. Together, we + are dedicated to making this a meaningful and enjoyable experience for all. +## The list + +1. Build and Sustain Trust: Commit to creating a reliable and supportive +environment where trust +underpins all interactions. +2. Foster Open Communication: Ensure a culture where all voices are valued, and + ideas, concerns, +and feedback are openly shared. +3. Respect Time and Focus: Honor each other’s time by striving for purposeful + and efficient +communication and collaboration. +4. Promote Team Growth: Support collective learning, personal development, and +the achievement +of shared goals. +5. Encourage Inclusivity: Create a space where diverse perspectives are +welcomed and everyone +feels empowered to contribute. +6. Ensure Clarity and Alignment: Maintain shared understanding and alignment on + goals, expectations, +and progress. +7. Cultivate a Positive Team Culture: Build a collaborative and motivating +environment that values +both achievements and relationships. +8. Embrace Growth from Challenges: Approach mistakes and challenges as +opportunities for learning and improvement. diff --git a/collaboration/constraints.md b/collaboration/constraints.md index 24079505c..f1a506e49 100644 --- a/collaboration/constraints.md +++ b/collaboration/constraints.md @@ -1,34 +1,65 @@ -# Constraints - -Some boundaries around our project. - -## External - - - -## Internal: Involuntary - - - -## Internal: Voluntary - - +# Constraints + +This document outlines the constraints for our collaborative project, helping us +focus on realistic goals and effective teamwork. Each member will solve two +problems by writing Python code, documenting it, and testing it. Additionally, +every member will review two problems written by others. The repository is a +group effort, reflecting everyone's contributions. + +## External + + + +- **Project Deadlines**: The project must be completed by **January 10**, with +internal deadlines for milestones ensuring consistent progress. +- **Technologies**: The project requires Python, GitHub, VSCode, and linting +tools for coding, collaboration, and quality assurance. +- **Time Constraints**: Members have limited availability due to full-time jobs +and university schedules. + +## Internal: Involuntary + + + +- **Skill Levels**: The team includes members with a mix of beginner and experienced +skill levels, with most members new to coding. +- **Time Availability**: Each member can dedicate only a few hours per week due +to other commitments. + +## Internal: Voluntary + + + +- **Problem Solving**: Each member will solve two problems by writing Python +code, ensuring the solutions are well-documented and thoroughly tested. +- **Code Reviews**: Every member will review two problems written by others, +providing constructive feedback to enhance quality and learning. +- **Coding Conventions**: The team has agreed on consistent coding styles and a +code review checklist to maintain clarity and quality in the repository. +- **Repository Collaboration**: All members will contribute to a shared GitHub +repository, promoting teamwork and collective ownership of the project. +- **Scope Management**: Realistic project goals have been set to balance +learning opportunities with completing a high-quality final product. +- **Tools Commitment**: The team will use GitHub for version control, VSCode for +development, and Python linting tools to ensure clean, efficient code. +- **Feedback Cycles**: A process for iterative feedback and reviews has been +established to improve both individual skills and project outcomes. diff --git a/collaboration/learning_goals.md b/collaboration/learning_goals.md index 11c583d2b..511ec7f87 100644 --- a/collaboration/learning_goals.md +++ b/collaboration/learning_goals.md @@ -1,5 +1,42 @@ -# Learning Goals +# Learning Goals -## Collective +Our team comprises ten members with diverse backgrounds, including those new to +coding and others with significant experience. This variety presents an excellent +opportunity for mutual learning and growth. Below are the learning goals we have +collectively identified for these exercises: -## Individual +## Objectives for Team Members New to Coding + +- **Build foundational knowledge**: Understand the basics of data structures (DSs) + and algorithms. +- **Learn programming best practices**: Focus on writing clean, readable, and well- + documented code. +- **Practice problem-solving**: Develop confidence in tackling coding problems +step by step. +- **Gain exposure to code review**: Learn how to give and receive constructive feedback + to improve solutions. + +## Objectives for Experienced Team Members + +- **Strengthen advanced skills**: Dive deeper into complex DSs and algorithms to +enhance problem-solving capabilities. +- **Experiment with new approaches**: Explore and apply new programming language +features to refine solutions. +- **Focus on optimization**: Work on producing efficient and scalable code. +- **Mentor and collaborate**: Guide less experienced team members to create an +inclusive and supportive learning environment. + +## Shared Team Objectives + +- **Learn through collaboration**: Share knowledge and perspectives to maximize +learning outcomes for everyone. +- **Improve development speed**: Practice writing solutions faster while maintaining +quality. +- **Foster a culture of feedback**: Embrace multiple cycles of review to improve +individual and team skills. +- **Document solutions effectively**: Ensure every solution is well-commented and +easy to understand for future reference. + +These goals reflect our commitment to leveraging our diverse skills and experiences +to grow together as a team. We’ll revisit and refine these objectives as needed +to ensure alignment with our progress and expectations. diff --git a/solutions/__init__.py b/solutions/__init__.py index 8b1378917..e69de29bb 100644 --- a/solutions/__init__.py +++ b/solutions/__init__.py @@ -1 +0,0 @@ - diff --git a/solutions/arithmetic_sequence.py b/solutions/arithmetic_sequence.py new file mode 100644 index 000000000..fbab5c1fc --- /dev/null +++ b/solutions/arithmetic_sequence.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +A module for generating a sequence for arithmetic numbers + +Module contents: + - arithmetic_sequence:generating a sequence of n arithmetic numbers. + +Created on Sunday/22/December/2024 +@author:Mayar Ali +""" + +# ---before documenting and testing--- + + +def arithmetic_sequence(sequence_length: int) -> list: + """ + list in which the difference between consecutive terms is constant. + Parameters: + sequence_length:int, greater than zero + + Returns -list[int] with the first n number of the arithmetic sequence + + Raises: + AssertionError : if the argument is not an integer + AssertionError : if the argument is less or equal to zero + + Examples: + >>>arithmetic_sequence(0) + [1] + >>>arithmetic_sequence(5) + [0 ,1 ,5 ,9 ,13] + >>>arithmetic_sequence(11) + [0 ,1 ,5 ,9 ,13 ,17 ,21 ,25 ,29 ,33 ,37 ] + """ + assert isinstance(sequence_length, int) + assert sequence_length >= 0 + + if sequence_length == 0: + return [] + if sequence_length == 1: + return [1] + if sequence_length == 2: + return [0, 1] + sequence = [0, 1] + while len(sequence) < sequence_length: + sequence.append(sequence[-1] + 3) + + return sequence + + +if __name__ == "__main__": + print(arithmetic_sequence(20)) diff --git a/solutions/armstrong_checker.py b/solutions/armstrong_checker.py new file mode 100644 index 000000000..087d35cfb --- /dev/null +++ b/solutions/armstrong_checker.py @@ -0,0 +1,42 @@ +"""Module checks if a number is an Armstrong number.""" + + +def armstrong_checker(number: int) -> str: + """ + Checks if a given positive integer is an Armstrong number. + + Parameters: + number (int): The number to check (must be > 0). + + Returns: + str: + - "True" if the number is an Armstrong number. + - "False" if the number is not an Armstrong number. + - "Invalid input" for invalid inputs. + + Raises: + AssertionError: If the input is not a positive integer. + + Examples: + >>> armstrong_checker(153) + 'True' + >>> armstrong_checker(123) + 'False' + >>> armstrong_checker(-153) + 'Invalid input' + """ + if not isinstance(number, int) or number < 0: + return "Invalid input" + + # Calculate the sum of the nth power of each digit in the number. + digits = [int(d) for d in str(number)] + # digits puts each digit in the number into a list + + n = len(digits) + # n is the number of digits in the number by using the len() function + + armstrong_sum = sum(d**n for d in digits) + # armstrong_sum is the sum of the nth power of each digit in the number + + return "True" if armstrong_sum == number else "False" + # if the sum of the nth power of each digit in the number is equal to the number, return "True", otherwise return "False" diff --git a/solutions/count_characters.py b/solutions/count_characters.py new file mode 100644 index 000000000..6ba169087 --- /dev/null +++ b/solutions/count_characters.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 +# -- coding: utf-8 -- +""" +Creates a function that counts the number of vowels (a, e, i, o, u) in a given string. +The function is case-insensitive, meaning both uppercase and lowercase vowels are counted. + +Author: Rafaa Ali +Created date: 3.1.2025 +""" + + +def count_characters(string: str) -> int: + """This function, `count_vowels`, counts the number of vowels in a given string, + ignoring case sensitivity. + + Parameters: + string (str): The input string to count vowels characters + + Returns: + int: The total number of vowels in the string + + assertion: + string must be string type otherwise error + + example: + Edge cases: + >>> count_characters("") + 0 + >>> count_characters("krm") + 0 + >>> count_characters(" ") + 0 + + Standard cases: + >>> count_characters lowercase("hello") + 2 + >>> count_characters uppercase("RAFF") + 1 + >>>count_characters mixed case("aEiOu") + 5 + + Defensive cases: + >>> count_characters(123) + AssertionError: Input must be string + >>>count_characters(["hello"]) + AssertionError: Input must be string + >>> count_characters(None) + AssertionError: Input must be string + """ + # assert an error when input is not string + assert isinstance(string, str), "Input must be string" + + # Convert string to lowercase for case-insensitive counting + string = string.lower() + + # Define vowels to check against + vowels = "aeiou" + + # Initialize counter for vowels + count = 0 + + # Loop through each character in the string + for char in string: + # If character is a vowel, increment counter + if char in vowels: + count += 1 + + # Return the total count of vowels + return count diff --git a/solutions/even_number_count.py b/solutions/even_number_count.py new file mode 100644 index 000000000..4f076d41c --- /dev/null +++ b/solutions/even_number_count.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +A function that counts the number of even numbers in a countdown from n to 1 + +Module contents: + - even_number_count: gen number for even numbers in the list. + +Created on Monday/ 30/ December/ 2024 +@author: Mayar Ali. +""" + + +def even_number_count(number: list) -> int: + """Returns the number of even numbers on the list. + + Parameters: + int: list, the input list to process + + return - > int: indicating the number of even number in the list + + Raises: + AssertionError: + + Examples: + >>> even_number_count ([1]) + 0 + >>> even_number_count ([2,1]) + 1 + >>> even_number_count ([3,2,1]) + 1 + """ + assert isinstance(number, list) + for num in number: + assert isinstance(num, int) + + count = 0 + + for num in number: + if num % 2 == 0: + count += 1 + return count + + +if __name__ == "__main__": + print(even_number_count([1, 2, 3, 4, 5])) diff --git a/solutions/fuel_gauge.py b/solutions/fuel_gauge.py new file mode 100644 index 000000000..fbc35ca08 --- /dev/null +++ b/solutions/fuel_gauge.py @@ -0,0 +1,39 @@ +"""module calculates the percentage of fuel in a tank and returns a status indicator.""" + + +def fuel_gauge(x: int, y: int) -> str: + """ + Calculates the percentage of fuel in a tank and returns a status indicator. + + Parameters: + x (int): Fuel in the tank (must be ≤ y). + y (int): Tank capacity (must be > 0). + + Returns: + str: + - "F" if percentage >= 90. + - "E" if percentage <= 10. + - "M" for all other cases. + - "Invalid input" for invalid inputs. + + Raises: + AssertionError: If y <= 0 or x > y. + + Examples: + >>> fuel_gauge(90, 100) + 'F' + >>> fuel_gauge(10, 100) + 'E' + >>> fuel_gauge(50, 100) + 'M' + """ + if y == 0 or x > y: + return "Invalid input" + + percentage = (x / y) * 100 + if percentage >= 90: + return "F" + elif percentage <= 10: + return "E" + else: + return "M" diff --git a/solutions/tests/__init__.py b/solutions/tests/__init__.py index 8b1378917..e69de29bb 100644 --- a/solutions/tests/__init__.py +++ b/solutions/tests/__init__.py @@ -1 +0,0 @@ - diff --git a/solutions/tests/test_arithmetic_sequence.py b/solutions/tests/test_arithmetic_sequence.py new file mode 100644 index 000000000..5fe1172a3 --- /dev/null +++ b/solutions/tests/test_arithmetic_sequence.py @@ -0,0 +1,164 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Monday/30/December/2024 +@author:Mayar Ali +""" + +import unittest + +# ---imports & test class before documenting and testing--- +# from ..arithmetic_sequence import arithmetic_sequence +# class TestArithmeticSequence(unittest.TestCase): +# ---imports & test class after documenting and testing--- + +from ..arithmetic_sequence import arithmetic_sequence + + +class TestArithmeticSequence(unittest.TestCase): + """Test the arithmetic_sequence function""" + + def test_0(self): + "It should evaluate 0 to []" + self.assertEqual(arithmetic_sequence(0), []) + + def test_1(self): + "Should evaluate 1 to [0]" + self.assertEqual(arithmetic_sequence(1), [1]) + + def test_2(self): + "Should evaluate 2 to [0,1]" + self.assertEqual(arithmetic_sequence(2), [0, 1]) + + def test_3(self): + "Should evaluate 3 to [0, 1, 5]" + self.assertEqual(arithmetic_sequence(3), [0, 1, 4]) + + # defensive cases + + def test_0_less_than_0(self): + """It should raise an assertion error if the argument is less than 0""" + with self.assertRaises(AssertionError): + arithmetic_sequence(-1) + + def test_1_not_an_integer(self): + """Should raise an assertion error if the argument is a float""" + with self.assertRaises(AssertionError): + arithmetic_sequence(1.0) + + def test_2_not_an_integer(self): + """Should raise an assertion error if the argument is not an integer""" + with self.assertRaises(AssertionError): + arithmetic_sequence(["1", 2, 3]) + + # Edge case + + def test_a_big_number(self): + "Should evaluate 100 to [0, 1, 5]" + self.assertEqual( + arithmetic_sequence(102), + [ + 0, + 1, + 4, + 7, + 10, + 13, + 16, + 19, + 22, + 25, + 28, + 31, + 34, + 37, + 40, + 43, + 46, + 49, + 52, + 55, + 58, + 61, + 64, + 67, + 70, + 73, + 76, + 79, + 82, + 85, + 88, + 91, + 94, + 97, + 100, + 103, + 106, + 109, + 112, + 115, + 118, + 121, + 124, + 127, + 130, + 133, + 136, + 139, + 142, + 145, + 148, + 151, + 154, + 157, + 160, + 163, + 166, + 169, + 172, + 175, + 178, + 181, + 184, + 187, + 190, + 193, + 196, + 199, + 202, + 205, + 208, + 211, + 214, + 217, + 220, + 223, + 226, + 229, + 232, + 235, + 238, + 241, + 244, + 247, + 250, + 253, + 256, + 259, + 262, + 265, + 268, + 271, + 274, + 277, + 280, + 283, + 286, + 289, + 292, + 295, + 298, + 301, + ], + ) diff --git a/solutions/tests/test_armstrong_checker.py b/solutions/tests/test_armstrong_checker.py new file mode 100644 index 000000000..54aec7a8a --- /dev/null +++ b/solutions/tests/test_armstrong_checker.py @@ -0,0 +1,24 @@ +import unittest + +from ..armstrong_checker import armstrong_checker + + +class TestArmstrongChecker(unittest.TestCase): + """Test cases for the armstrong_checker function.""" + + def test_valid_armstrong_numbers(self): + """Test cases where the number is an Armstrong number.""" + self.assertEqual(armstrong_checker(153), "True") + self.assertEqual(armstrong_checker(9474), "True") + self.assertEqual(armstrong_checker(9475), "False") + + def test_non_armstrong_numbers(self): + """Test cases where the number is not an Armstrong number.""" + self.assertEqual(armstrong_checker(123), "False") + self.assertEqual(armstrong_checker(100), "False") + + def test_invalid_inputs(self): + """Test cases for invalid inputs.""" + self.assertEqual(armstrong_checker(-153), "Invalid input") + self.assertEqual(armstrong_checker("153"), "Invalid input") + self.assertEqual(armstrong_checker(0.5), "Invalid input") diff --git a/solutions/tests/test_count_characters.py b/solutions/tests/test_count_characters.py new file mode 100644 index 000000000..409ccc6f9 --- /dev/null +++ b/solutions/tests/test_count_characters.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python3 +# -- coding: utf-8 -- +""" +test_count_characters.py +this module contains unit tests for the 'count_characters' +function + +""" + +import unittest + +from ..count_characters import count_characters + + +class TestCountCharacters(unittest.TestCase): + # Edge cases: + def test_empty_string(self): + """check if the input is empty string""" + self.assertEqual(count_characters(""), 0) + + def test_no_vowels(self): + """check if string has no vowels""" + self.assertEqual(count_characters("krm"), 0) + + """check if string is just whitespace""" + self.assertEqual(count_characters(" "), 0) + + # Standard cases: + def test_lowercase_word(self): + """check if handles lowercase correctly""" + self.assertEqual(count_characters("hello"), 2) + + def test_uppercase_word(self): + """check if handles uppercase correctly""" + self.assertEqual(count_characters("RAFF"), 1) + + def test_mixed_case(self): + """check if handles mixed case correctly""" + self.assertEqual(count_characters("aEiOu"), 5) + + def test_sentence(self): + """check if handles full sentence correctly""" + self.assertEqual(count_characters("Hello World"), 3) + + def test_all_vowels(self): + """check if counts all vowel types correctly""" + self.assertEqual(count_characters("AeIoU"), 5) + + # defensive cases + def test_number_input(self): + """It should raise AssertionError for integer input""" + with self.assertRaises(AssertionError): + count_characters(123) + + def test_list_input(self): + """It should raise AssertionError for list input""" + with self.assertRaises(AssertionError): + count_characters(["hello"]) + + def test_none_input(self): + """It should raise AssertionError for None input""" + with self.assertRaises(AssertionError): + count_characters(None) + + def test_float_input(self): + """It should raise AssertionError for float input""" + with self.assertRaises(AssertionError): + count_characters(3.14) diff --git a/solutions/tests/test_even_number_count.py b/solutions/tests/test_even_number_count.py new file mode 100644 index 000000000..303ee6a07 --- /dev/null +++ b/solutions/tests/test_even_number_count.py @@ -0,0 +1,274 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Monday/ 30/ December/2024 +@author: Mayar Ali + +""" + +import unittest + +# --- imports & test class before documenting and testing --- + +# from ..TestEvenNumberCount import TestEvenNumberCount + +# class TestTestEvenNumberCount(unittest.TestCase): + +# --- imports & test class after documenting and testing --- + +from ..even_number_count import even_number_count # type: ignore + + +class TestEvenNumberCount(unittest.TestCase): + """test the even_number_count function""" + + def test_0(self): + """It should return zero""" + self.assertEqual(even_number_count([1]), 0) + + def test_1(self): + """Count the number of even numbers in a countdown from n to 1""" + self.assertEqual(even_number_count([1, 2]), 1) + + def test_2(self): + """Count the number of even numbers in a countdown from n to 1""" + self.assertEqual(even_number_count([1, 2, 3]), 1) + + def test_3(self): + """Count the number of even numbers in a countdown from n to 1""" + self.assertEqual(even_number_count([1, 2, 3, 4]), 2) + + def test_4(self): + """Count the number of even numbers in a countdown from n to 1""" + self.assertEqual(even_number_count([1, 2, 3, 4, 5]), 2) + + def test_5(self): + """Count the number of even numbers in a countdown from n to 1""" + self.assertEqual(even_number_count([1, 2, 3, 4, 5, 6]), 3) + + def test_6(self): + """Count the number of even numbers in a countdown from n to 1""" + self.assertEqual(even_number_count([1, 2, 3, 4, 5, 6, 7]), 3) + + # Boundary case + + def test_big_numbers(self): + """it should evaluate 100 to [1,2,3,4,5,...]""" + self.assertEqual( + even_number_count( + [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139, + 140, + 141, + 142, + 143, + 145, + 146, + 147, + 148, + 149, + 150, + 151, + 152, + 153, + 154, + 155, + 156, + 157, + 158, + 159, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 174, + 175, + 176, + 177, + 178, + 179, + 180, + 181, + 182, + 183, + 184, + 185, + 186, + 187, + 188, + 189, + 190, + 191, + 192, + 193, + 194, + 195, + 196, + 197, + 198, + 199, + 200, + ] + ), + 99, + ) + + # Defensive cases + + def test_0_less_than_0(self): + """Raise an assertion error if the there is a string within a list""" + with self.assertRaises(AssertionError): + (even_number_count([1, 2, "-6", 4]),) + + def test_0_less_than_1(self): + """Raise an assertion error if the there is a list within a list""" + with self.assertRaises(AssertionError): + even_number_count([1, 2, [1, 2, 3], 4]) diff --git a/solutions/tests/test_fuel_gauge.py b/solutions/tests/test_fuel_gauge.py new file mode 100644 index 000000000..d1d8aed8a --- /dev/null +++ b/solutions/tests/test_fuel_gauge.py @@ -0,0 +1,30 @@ +import unittest + +from ..fuel_gauge import fuel_gauge + + +class TestFuelGauge(unittest.TestCase): + """Test cases for the fuel_gauge function.""" + + def test_full(self): + """Test cases where the percentage is 90% or more it should result in F.""" + self.assertEqual(fuel_gauge(90, 100), "F") + self.assertEqual(fuel_gauge(100, 100), "F") + self.assertEqual(fuel_gauge(97, 100), "F") + + def test_empty(self): + """Test cases where the percentage is 10% or less it should result E.""" + self.assertEqual(fuel_gauge(10, 100), "E") + self.assertEqual(fuel_gauge(0, 100), "E") + self.assertEqual(fuel_gauge(2, 100), "E") + + def test_percentage(self): + """Test cases where the result is between 90 and 10 it should be M.""" + self.assertEqual(fuel_gauge(71, 100), "M") + self.assertEqual(fuel_gauge(23, 100), "M") + self.assertEqual(fuel_gauge(10, 50), "M") + + def test_invalid_input(self): + """Test cases for invalid inputs.""" + self.assertEqual(fuel_gauge(6, 0), "Invalid input") + self.assertEqual(fuel_gauge(7, -1), "Invalid input")