Write a program to overload the following methods. Create an object of the class and call from main method palindrome(int no)->returns true if no is palindrome else false palindrome(String word)-> returns true if word is palindrome else false
Answers
Answered by
0
Answer:
# function which return reverse of a string
def isPalindrome(s):
return s == s[::-1]
# Driver code
s = "malayalam"
ans = isPalindrome(s)
if ans:
print("Yes")
else:
print("No")
Similar questions
English,
5 months ago
Math,
5 months ago
Social Sciences,
5 months ago
Math,
10 months ago
Environmental Sciences,
1 year ago
Math,
1 year ago
Math,
1 year ago