Compare Last Three Characters
Write a program to check if the last three characters in the two given strings are the same.
The first and second lines of inputs are strings.
The output should be either
Given strings are
apple, pimple. In both the strings, the last three characters ple are common. So the output should be
True
firstString = input()[-3:]
secondString = input()[-3:]
print(firstString==secondString)
Comments
Leave a comment