What if we couldn't use a standard function because the order of parameters wasn't the same?
from operator import contains common_substring = lambda a, b: contains(b, a)
from operator import contains as common_substring- from operator import contains
- common_substring = lambda a, b: contains(b, a)
test.assert_equals(common_substring("lo", "Hello"), True) test.assert_equals(common_substring("hello", "HELLO"), False) test.assert_equals(common_substring("car", "racecar"), True) test.assert_equals(common_substring("car", "CAR Car cAr caR"), False) test.assert_not_equals(common_substring("roror", "rororororor"), False, ) test.expect(str,)
test.assert_equals(common_substring("Hello", "lo"), True)test.assert_equals(common_substring("HELLO", "hello"), False)test.assert_equals(common_substring("racecar", "car"), True)test.assert_equals(common_substring("CAR Car cAr caR", "car"), False)- test.assert_equals(common_substring("lo", "Hello"), True)
- test.assert_equals(common_substring("hello", "HELLO"), False)
- test.assert_equals(common_substring("car", "racecar"), True)
- test.assert_equals(common_substring("car", "CAR Car cAr caR"), False)
test.assert_not_equals(common_substring("rororororor", "roror"), False, )- test.assert_not_equals(common_substring("roror", "rororororor"), False, )
- test.expect(str,)