Answer to Question #335753 in Python for Elle Joy

Question #335753

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.

1
Expert's answer
2022-05-01T19:06:21-0400

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()))



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS