+ 2
Challenge : convert the string into lowercase and check it is palindrome or not !!!
Example : ABCBA abcba abcba is palindrome any programming languages are welcome
7 Answers
+ 12
#python
a=input().lower()
print(a+' is palindrom.' if a==a[::-1] else a+' is not palindrom.')
+ 8
my code ignores uppercase and spaces and punctuation. https://code.sololearn.com/WpbOkxJE38uu/?ref=app
+ 3
This is Python, using recursion:
def palChecker(s):
def lowerS(s):
s = s.lower()
res = ''
for i in s:
if i in 'abcdefghijk\
lmnopqrstu\
vwxyz':
res = res + i
return res
def isPal(s):
if len(s) <= 1:
return True
res = (s[0] == s[-1]) and \
isPal(s[1:-1])
return res
return isPal(lowerS(s))
+ 1
Not sure if it's exactly the same, but that's the basic implementation I learned from a John Guttag book, by the way.
+ 1
My attempt to this specific challenge. Take a look :)
Explanations inside the code
https://code.sololearn.com/cIv01PihW4aq/?ref=app
Here are other 2 Palindrome Checkers I made to other challenges :)
https://code.sololearn.com/c8OLa6oPvk6V/?ref=app
https://code.sololearn.com/cKX1twtIeLb0/?ref=app
+ 1
My other solution to this challenge, now using Python
https://code.sololearn.com/c1i11OZmzrl1/?ref=app