Elle Joy Vasquez
Preliminary Test 02
Create Python function that checks whether a passed string is PALINDROME or NOT.
Note: A palindrome is a word, phrase, or sequence that reads the same backward as forward, e.g., madam or nurses run.
def palindrome(s):
f_s = s.split()
s_s = s[::-1].split()
if ''.join(f_s) == ''.join(s_s):
return 'YES, its palindrome'
else:
return 'NO, its not palindrome'
print(palindrome(input()))
Comments
Leave a comment