Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def reverse(s):
- return s[::-1]
- def isPalindrome(s):
- # Calling reverse function
- rev = reverse(s)
- # Checking if both string are equal or not
- if (s == rev):
- return True
- return False
- # Driver code
- s = "malayalam"
- ans = isPalindrome(s)
- if ans == 1:
- print("Yes")
- else:
- print("No")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement