This question already has answers here:
How to check for palindrome using Python logic
(35 answers)
Reverse a string in Python
This question already has answers here:
How to check for palindrome using Python logic
(35 answers)
Reverse a string in Python
(18 answers)
Closed 3 hours ago.
开发者_如何学编程
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")
精彩评论