Exemplo n.º 1
0
 def testD_emptyWordIsNotPalindrome(self):
     self.assertFalse(isWordPalindrome(""))
     print("Test testD_emptyWordIsNotPalindrome pass")
Exemplo n.º 2
0
 def testC_mixedPalindrome(self):
     self.assertTrue(isWordPalindrome("123x321"))
     print("Test testC_mixedPalindrome pass")
Exemplo n.º 3
0
 def testA_palindromeWords(self):
     for i in range(len(self.testdata)):
         self.assertTrue(isWordPalindrome(self.testdata[i][:-1]))
     print(".Test testA_palindromeWords pass on", i, "samples")
Exemplo n.º 4
0
 def testB_palindromeNumber(self):
     self.assertTrue(isWordPalindrome("12321"))
     self.assertTrue(isWordPalindrome("2345678765432"))
     print("Test testB_palindromeNumber pass")
Exemplo n.º 5
0
from palindrome import isWordPalindrome

print("Is word palindrome:", isWordPalindrome(input("Enter a word: ")))