• + 0 comments

    import re N = int(input()) A = [] for i in range(N): A.append(input()) text = ''.join(A).replace(" ",'') #To Replace all the white spaces pattern = r'#(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})(?!{)\b' # codes = re.findall(pattern, text) for code in list(codes): print(code)