Answer to Question #283073 in Python for Raju

Question #283073

write a python program to print the following output.


sample input1

bew web

sample output1

Yes


sample input2

race care

sample output2

No


1
Expert's answer
2021-12-27T15:50:56-0500
line = input()
w1, w2 = line.split()


if ​len(w1) != len(w2):
    print("No")
    exit()


for ​i in range(len(w1)):
    if w1[i] != w2[-1-i]:
        print("No")
        break
else:
    print("Yes")

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