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