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