• + 0 comments
    import os, sys, re
    
    text = sys.stdin.read()
    pattern = r"(?<=\s)(&{2}|[|]{2})(?=\s)"
    
    def modified_match(match_object):
    
        if match_object.group() == '&&':
            return 'and'
        else:
            return 'or'
    
    text = re.sub(pattern, modified_match, text)
    print(os.linesep.join(text.splitlines()[1:])) #removes the line count at line n°1