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