Example #1
0
def is_bin_palindrome(num):
    return is_palindrome(int(to_binary_str(num)))
Example #2
0
def is_both_palindrome(num):
    return is_palindrome(num) and is_bin_palindrome(num)
Example #3
0
 def test_is_palindrome_zero(self):
     self.assertEqual(is_palindrome("o"), True)
Example #4
0
 def test_is_palindrome_positive_even(self):
     self.assertEqual(is_palindrome("osso"), True)
Example #5
0
 def test_is_palindrome_negative_odd(self):
     self.assertEqual(is_palindrome("lavas"), False)
Example #6
0
 def test_is_palindrome_negative_even(self):
     self.assertEqual(is_palindrome("oslo"), False)
Example #7
0
 def test_is_palindrome_positive_odd(self):
     self.assertEqual(is_palindrome("laval"), True)
Example #8
0
def is_both_palindrome(num):
    return is_palindrome(num) and is_bin_palindrome(num)
Example #9
0
def is_bin_palindrome(num):
    return is_palindrome(int(to_binary_str(num)))