• try find answer

Question related to mission Between Markers

 

i thing i task solved but second answer like "Htlm, No opened, One sym" do i need check answer od print this ? example apple is my answer but "one sym" is also answer?

def between_markers(text: str, begin: str, end: str) -> str:
    x=text.find(begin)
    if x != 0:
        y = text.find(end)
        if y!= 0:
            return text[x+1:y]
         #znaleziony poczatek
    else:#1
        y = text.find(end)
        if y<begin:
                print('')
            if y!=0:
                return text[0:y]
            else:#2
                return text[0:+1]#3


    if __name__ == '__main__':
        print('Example:')
        print(between_markers('What is >apple<', '>', '<'))

    # These "asserts" are used for self-checking and not for testing
    assert between_markers('What is >apple<', '>', '<') == "apple", "One sym"