You are viewing a single comment's thread. Return to all comments →
matrix = [list(i) for i in zip(*matrix)] matrix = sum(matrix, []) string = "".join(matrix)
pattern = "[A-Za-z0-9][^A-Za-z0-9]+[A-Za-z0-9]"
betweens = re.findall(pattern, string) for substr in betweens: string = string.replace(substr[1:-1], ' ', 1)
print(string)
Seems like cookies are disabled on this browser, please enable them to open this website
Matrix Script
You are viewing a single comment's thread. Return to all comments →
matrix = [list(i) for i in zip(*matrix)] matrix = sum(matrix, []) string = "".join(matrix)
pattern = "[A-Za-z0-9][^A-Za-z0-9]+[A-Za-z0-9]"
betweens = re.findall(pattern, string) for substr in betweens: string = string.replace(substr[1:-1], ' ', 1)
print(string)