Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def test_suite():
- for tst, exp in test_inputs.items():
- actual = check_palindrome(tst)
- if actual == exp:
- print("OK")
- else:
- print("NOK")
- def check_palindrome(string):
- x = string[::-1]
- if x==string:
- # Your code goes here
- return True # to indicate that the input string is a palindrome
- else:
- return False
- # Main test cases
- test_inputs = \
- {
- "radar" : True, # test string : expected status
- "panama" : False,
- "Madman" : False,
- "TCATGAACGTCTTCTGCAAGTACT" : True,
- "GACATACTCCTCCACCTCATACAG" : False,
- }
- test_suite()
Add Comment
Please, Sign In to add comment