A palindrome is a word, verse, or sentence (such as "Able was I ere I saw Elba") or a number (such as 1881) that reads the same backward or forward (Merriam-Webster)
In this assignment, you will elaborate an algorithm which will validate that an
input string is a palindrome using the deque data type and its
unique high-performance features.
Using TDD to develop the algorithm, write a single function which will accept a single parameter like so:
is_palindrome(value: str) -> bool(/2)Write a function calledis_palindromein a Python module calledpalindrome.py.(/1)Write your tests in a module calledtest_palindrome.py(/1)Theis_palindromefunction must accept a single parameter(/2)The function may return eitherTrueorFalse, or raise aValueError.(/4)Use adequecontainer and its unique methods to determine if the value provided to the function is a palindrome
Using TDD, assert the following statements in tests. Only write one test at a time, make it pass using code. Commit each step and push to Github before moving on to the next assertion. It is possible for a subsequent test to already pass without having to write additional code.
Do not write all the tests, then all the code or vice-versa.
(/1)is_palindromeraises aValueErrorwhen not provided with a value that is an instance ofstr.(/1)is_palindromereturnsFalsewhen called with an empty string.(/1)is_palindromereturnsTrueif called with"a".(/1)is_palindromereturnsTrueif called with"bb".(/1)is_palindromereturnsFalseis called with"abc".(/1)is_palindromereturnsTruewhen called with"laval".(/1)is_palindromereturnsFalsewhen called with"toronto".(/1)is_palindromereturnsTruewhen called with"Able was I ere I saw Elba".
Note: this function must accept any value, not just respond to the scenarios listed above.
The Travis CI build must pass. 1% will be deducted for each reported code style error.