def equal_last(str1, str2):
str1 = list(str1)
str2 = list(str2)
str1.reverse()
str2.reverse()
last_three1 = str1[0:3]
last_three2 = str2[0:3]
if last_three2 == last_three1:
print("True\n")
else:
print("False\n")
print("Sample Input 1")
print("apple")
print("pimple")
print("Sample Output 1")
equal_last("apple","pimple")
print("\n\nSample Input 2")
print("meals")
print("deal")
print("Sample Output 2")
equal_last("meals","deal")
Comments
Leave a comment