回答編集履歴
1
コード修正
answer
CHANGED
@@ -4,6 +4,6 @@
|
|
4
4
|
[ignore spaces when comparing strings in python](https://stackoverflow.com/questions/16431964/ignore-spaces-when-comparing-strings-in-python)
|
5
5
|
```Python
|
6
6
|
import difflib
|
7
|
-
s = difflib.SequenceMatcher(lambda x: x in " \t", 'abc', '
|
7
|
+
s = difflib.SequenceMatcher(lambda x: x in " \t", 'abc', 'a bc').ratio()
|
8
8
|
print("match ratio:", s, "\n") # 一致(3+3) / 全体(3+4) = 6/7 = 0.8571428571428571
|
9
9
|
```
|