You are viewing a single comment's thread. Return to all comments →
Managed to more or less fit all replacement logic into one line:
import re n = int(input()) for _ in range(n): print(re.sub(r"(?<= )\|\|(?= )", "or", re.sub(r"(?<= )&&(?= )", "and", input())))
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 →
Managed to more or less fit all replacement logic into one line: