We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
who would read 20 lines when you could solve this problem in 3 lines.
decoded_matrix = "".join(["".join(column) for column in zip(*matrix)])
match = re.sub(r"(?<=\w)[!@#$%& ]+(?=\w)", " ", decoded_matrix)
print(match)
Matrix Script
You are viewing a single comment's thread. Return to all comments →
I am confused about why this is not working. If anyone can help I'll apreceate.
The challenge says to not use if
It is true! Than you for your observation.
who would read 20 lines when you could solve this problem in 3 lines. decoded_matrix = "".join(["".join(column) for column in zip(*matrix)]) match = re.sub(r"(?<=\w)[!@#$%& ]+(?=\w)", " ", decoded_matrix) print(match)
You are totally right! Thank you!