I have a python related question that I could not get through. The question is:
Ends on
For two lines, return True if one of the lines appears at the very end of the other line, ignoring the upper / lower case difference (in other words, the calculation should not be case sensitive).
My decision:
def end_other(a,b): s1=a.lower() s2=b.lower() if len(s1)>len(s2): if s1[-len(s2)]==s2[-len(s2)]: return True if len(s1)<len(s2): if s1[-len(s1)]==s2[-len(s1)]: return True if len(s1)==len(s2): if s1[-len(s1)]==s2[-len(s2)]: return True else: return False
But the "Error Message" window shows: all public tests passed, but some private tests failed. You need to summarize your decision.
What is the problem with my solution? Or is there something I missed?
source share