質問編集履歴

2

要素の変更

2020/10/06 09:54

投稿

taiki9121
taiki9121

スコア18

test CHANGED
File without changes
test CHANGED
@@ -32,7 +32,7 @@
32
32
 
33
33
  "#22 #23 bbb#24 25",
34
34
 
35
- "#27 #28 #29 #30 #31"] # #30と#31の間には全角スペースが入っている
35
+ "ccc#27 #28 ddd #29 #30 #31"] # #30と#31の間には全角スペースが入っている
36
36
 
37
37
 
38
38
 

1

要素の変更

2020/10/06 09:54

投稿

taiki9121
taiki9121

スコア18

test CHANGED
File without changes
test CHANGED
@@ -24,23 +24,29 @@
24
24
 
25
25
 
26
26
 
27
- descriptions = ["1 #2 #3 #4 #5 #6 #7",
27
+ description = ["1 #2 #3 #4 #5 #6 #7",
28
28
 
29
29
  "#8#9#10#11#12#13#14",
30
30
 
31
- "#15 #16 #17 #18#19#20#21",
31
+ "#15 aaa#16 #17 #18#19#20#21",
32
32
 
33
- "#22 #23 26 #24 25"]
33
+ "#22 #23 bbb#24 25",
34
+
35
+ "#27 #28 #29 #30 #31"] # #30と#31の間には全角スペースが入っている
36
+
37
+
34
38
 
35
39
  res = list(get_hash_tags(descriptions ))
36
40
 
37
41
  print(res) # [['#2', '#3', '#4', '#5', '#6', '#7'],
38
42
 
39
-         ['#8#9#10#11#12#13#14'],
43
+ ['#8#9#10#11#12#13#14'],
40
44
 
41
-         ['#15', '#16', '#17', '#18#19#20#21'],
45
+ ['#15', '#16', '#17', '#18#19#20#21'],
42
46
 
43
-         ['#22', '#23', '#24']]
47
+ ['#22', '#23', '#24'],
48
+
49
+ ['#27', '#28', '#29', '#30', '#31']]
44
50
 
45
51
  ```
46
52
 
@@ -58,12 +64,14 @@
58
64
 
59
65
  ```ここに言語を入力
60
66
 
61
- print(res) # [['#2', '#3', '#4', '#5', '#6', '#7'],
67
+ print(res) # [['#2', '#3', '#4', '#5', '#6', '#7'],
62
68
 
63
-         ['#8', '#9', '#10', '#11', '#12', '#13', '#14'],
69
+ ['#8', '#9', '#10', '#11', '#12', '#13', '#14'],
64
70
 
65
-         ['#15', '#16', '#17', '#18', '#19', '#20', '#21'],
71
+ ['#15', '#16', '#17', '#18', '#19', '#20', '#21'],
66
72
 
67
-         ['#22', '#23', '#24']]
73
+ ['#22', '#23', '#24'],
74
+
75
+ ['#27', '#28', '#29', '#30', '#31']]
68
76
 
69
77
  ```