We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
0 parents commit b4a3147Copy full SHA for b4a3147
tb1_pemrograman_lanjut.py
@@ -0,0 +1,30 @@
1
+'''
2
+Nama: Naufal Rahfi Anugerah
3
+NIM: 41822010038
4
5
+
6
+import re
7
8
+first_input = input().rstrip().split()
9
+n = int(first_input[0])
10
+m = int(first_input[1])
11
12
+matrix = []
13
+for _ in range(n):
14
+ matrix_items = input()
15
+ matrix.append(matrix_items)
16
17
+decode_msg = ""
18
+for i in range(m):
19
+ for j in range(n):
20
+ try:
21
+ decode_msg += matrix[j][i]
22
+ except IndexError:
23
+ pass
24
25
+pattern = r'(?<=[\w])[^\w]+(?=[\w])'
26
+match_msg = re.findall(pattern, decode_msg)
27
28
+for x in match_msg:
29
+ decode_msg = decode_msg.replace(x, ' ', 1)
30
+print(decode_msg)
text.txt
@@ -0,0 +1,8 @@
+7 3
+Tsi
+h%x
+i #
+sM
+$a
+#t%
+ir!
0 commit comments