check whether the sting is palindrome or not? [duplicate]
if yes then print the string is palindrome
code using if else and basic python
Input : malayalam Output : Yes
Input : geeks Output : No
def isPalindrome(s): return s == s[::-1]
s = "malayalam" ans = is Palindrome(s)
if ans: print("Yes this is a palindrome") else: print("No")
精彩评论