Skip to content

Commit 9cdccd8

Browse files
authored
Update number-of-valid-words-in-a-sentence.py
1 parent c85ec16 commit 9cdccd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/number-of-valid-words-in-a-sentence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def countValidWords(self, sentence):
1515
token = hyphen = 0
1616
continue
1717
if sentence[i].isdigit() or \
18-
(sentence[i] in '!.,' and not (i == len(sentence)-1 or sentence[i+1] == ' ')) or \
18+
(sentence[i] in "!.," and not (i == len(sentence)-1 or sentence[i+1] == ' ')) or \
1919
(sentence[i] == '-' and not (hyphen == 0 and 0 < i < len(sentence)-1 and sentence[i-1].isalpha() and sentence[i+1].isalpha())):
2020
token = -1
2121
continue

0 commit comments

Comments
 (0)