Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. def test():
  2. test_data = [
  3. ("12321", True),
  4. ("1221", True),
  5. ("123", False),
  6. ("111", True),
  7. ("1122", False),
  8. ("111", True),
  9. ("1", True),
  10. ("ada", True),
  11. ("aaa", True),
  12. ("bacb", False)
  13. ]
  14. fl = 0
  15. for a, res in test_data:
  16. try:
  17. if (is_palindrome(a) == res):
  18. fl = 1
  19. else:
  20. raise Exception
  21. except Exception:
  22. print("NO")
  23. fl = 0
  24. break
  25. if (fl == 1):
  26. print("YES")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement