Answer to Question #224621 in Python for Hari nadh babu

Question #224621
s = input()
s = s.lower()
s2 = s.split()
s3 = ''.join(s2)
if s3 == s3[::-1]:
 print("True")
else:
 print("False")

In this python program it has three test cases, in this three test cases two test cases are getting expected output and third test case are not getting expected output. Please give me expexted output for three test cases. Thank you !

Question url :-

https://drive.google.com/file/d/1ZELb2KSvV36MM4kiF-dTFTC43CeUiFH9/view?usp=sharing

Test case - 1

Input

No lemon no melon

Output

True

 

Test case - 2

Input

Race Cars

Output

False

 

Test case - 3

Input

God’s Dog

Output

True


1
Expert's answer
2021-08-12T02:33:15-0400
string = ''.join(input().lower().replace("'", '').split())


if string == string[::-1]:
    print('True')
else:
    print('False')

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