daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Jan 24th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def test_suite():
  2.     for tst, exp in test_inputs.items():
  3.         actual = check_palindrome(tst)
  4.         if actual == exp:
  5.             print("OK")
  6.         else:
  7.             print("NOK")
  8.  
  9. def check_palindrome(string):
  10.     x = string[::-1]
  11.     if x==string:
  12.     # Your code goes here
  13.         return True # to indicate that the input string is a palindrome
  14.     else:
  15.         return False
  16.    
  17.  
  18. # Main test cases
  19. test_inputs = \
  20.     {
  21.         "radar" : True, # test string : expected status
  22.         "panama" : False,
  23.         "Madman" : False,
  24.         "TCATGAACGTCTTCTGCAAGTACT" : True,
  25.         "GACATACTCCTCCACCTCATACAG" : False,
  26.     }
  27.      
  28.  
  29.  
  30. test_suite()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top