You are viewing a single comment's thread. Return to all comments →
import re n = int(input()) s = "\n".join([input() for _ in range(n)]) patern = r'(?<=\s)&&(?=\s)|(?<=\s)\|\|(?=\s)' print(re.sub(patern, lambda m: 'and' if m.group(0) == '&&' else 'or', s))
Seems like cookies are disabled on this browser, please enable them to open this website
Regex Substitution
You are viewing a single comment's thread. Return to all comments →