Question #318366

compare last three characters


write a program to check if the last three characters in the given two strings are same.


input

the first and second lines of inputs are the same.


output

the output should be either True or False


Explanation

given strings are apple , pimple. in both strings,the last three characters ple are common.


sample input 1

apple

pimple


sample output 1

True


sample input 2

meals

deal


sample output 2

False


Expert's answer

str1 = input("Input string 1: ")
str2 = input("Input string 2: ")
if str1[-3:len(str1)] == str2[-3:len(str2)]:
    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!

LATEST TUTORIALS
APPROVED BY CLIENTS