Start and End Position of symbols in a string
I am trying to find the start and end position of _ in a string as list of tuples. The code I used is sentence = ‘special events _______ ______ ___ _______ ____ _____ _______ ___________ brochure subscriptions ticket guide’ symbol = ‘_’ position = [(match.start(),match.end()) for match in re.finditer(symbol, sentence)] For this the output… Read More Start and End Position of symbols in a string