Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

Python String function

Looking to put together a simple python function that checks the following

Given two strings, return True if either of the strings appears at the very end of the other string, ignoring upper/lower case differences (in other words, the computation should not be "case sensitive").

end_other('Hiabc', 'abc') → True
end_other('AbC', 'HiaBc') → True
end_other('abc', 'abXabc') → True

Answer*

Draft saved
Draft discarded
Cancel
5
  • netiquette contemplates citing previous answers, if repeated in yours Commented Oct 20, 2015 at 8:00
  • Just edited it, I started writing the answer before any other so haven't seen it @Pynchia Commented Oct 20, 2015 at 8:01
  • can you explan this code please ? I dont understand the if statements and the syntax there Commented Oct 20, 2015 at 8:06
  • this also gives true for everything , even if it should return false Commented Oct 20, 2015 at 8:11
  • Commented and explained @johndoe12345. Please show me a case where it returns true and should return false.. Commented Oct 20, 2015 at 8:12

lang-py

AltStyle によって変換されたページ (->オリジナル) /