Example #1
0
def is_palindrome(num, base=True):
    """
    >>> is_palindrome(585)
    True
    """
    if not solutions.is_palindrome(num):
        return False
    return solutions.is_palindrome(convert_to_base(num))
Example #2
0
    def test_one_character(self):
        teststr = "a"

        expected = True
        actual = is_palindrome(teststr)

        self.assertEqual(expected, actual)
Example #3
0
    def test_negative_odd(self):
        teststr = "abcdefg"
        
        expected = False
        actual = is_palindrome(teststr)

        self.assertEqual(expected, actual)
Example #4
0
    def test_case_9(self):
        string = 'abcdefghihgfeddcba'

        expected = False
        actual = is_palindrome(string)

        self.assertEqual(expected, actual)
Example #5
0
    def test_case_7(self):
        string = 'abcdefghhgfedcba'

        expected = True
        actual = is_palindrome(string)

        self.assertEqual(expected, actual)
Example #6
0
    def test_case_5(self):
        string = 'abb'

        expected = False
        actual = is_palindrome(string)

        self.assertEqual(expected, actual)
Example #7
0
    def test_case_2(self):
        string = 'a'

        expected = True
        actual = is_palindrome(string)

        self.assertEqual(expected, actual)