回答編集履歴
1
追記
test
CHANGED
@@ -27,3 +27,23 @@
|
|
27
27
|
print(word)
|
28
28
|
|
29
29
|
```
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
---
|
34
|
+
|
35
|
+
なお - — の並びを - に置換したいのなら、**正規表現**が便利です。
|
36
|
+
|
37
|
+
```Python
|
38
|
+
|
39
|
+
import re
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
for word in wordbox:
|
44
|
+
|
45
|
+
word = re.sub(r'[-—]+', r'-', word)
|
46
|
+
|
47
|
+
print(word)
|
48
|
+
|
49
|
+
```
|