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
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")
Comments
Leave a comment