• My solution should not pass the check

Question related to mission Between Markers

 

My solution is:

between_markers = lambda a, b, c: a[a.find(b)+1: a.find(c)].lstrip(b) if c in a else a[a.find(b)+1:].lstrip(b)

It is an interminable solution and lack of readability, but I thought it is at least correct. However, after it showed "Task solved" I realized it is not. For example,

between_markers("<head><title>titleMy new site</title></head>",
                                         "<title>", "</title>")

will get the result 'My new site' rather than the expected 'titleMy new site'.

Hope you can add some extra checks in order to block such solutions. Thx

10