Guest User

Untitled

a guest
Jan 24th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  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()
Add Comment
Please, Sign In to add comment