0

if yes then print the string is palindrome

code using if else and basic python

Input : malayalam Output : Yes

Input : geeks Output : No

1 Answers1

0

def isPalindrome(s): return s == s[::-1]

s = "malayalam" ans = is Palindrome(s)

if ans: print("Yes this is a palindrome") else: print("No")