Compare Last Three Characters
This Program name is Compare Last Three Characters. Write a Python program Compare Last Three Characters, it has two test cases
The below link contains Compare Last Three Characters - question, explanation and test cases
https://drive.google.com/file/d/1_oj4CCIYU5X0VuwscEnUwUGfWxN53Psq/view?usp=sharing
We need exact output when the code was run
def cmp(a:str, b:str) -> bool:
return a[-1] == b[-1] and a[-2] == b[-2] and a[-3] == b[-3]
def main():
print(cmp(input(), input()))
if __name__ == '__main__':
main()
Comments
Leave a comment