Answer to Question #282804 in Python for Raju

Question #282804

write a program to print the folllowing word and after the word there is space and after the space word will reversed if it is alphabets are equal in any position before spacing then print "Yes"


sample Input 1

bew web

sample output 1

Yes


sample input 2

race care

sample output 2

No


1
Expert's answer
2021-12-27T08:38:52-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