mirror of
https://github.com/python/cpython.git
synced 2025-07-29 22:24:49 +00:00
Merge
This commit is contained in:
commit
0580cbb164
1 changed files with 1 additions and 1 deletions
|
@ -215,7 +215,7 @@ For example::
|
|||
|
||||
>>> # Find the ten most common words in Hamlet
|
||||
>>> import re
|
||||
>>> words = re.findall('\w+', open('hamlet.txt').read().lower())
|
||||
>>> words = re.findall(r'\w+', open('hamlet.txt').read().lower())
|
||||
>>> Counter(words).most_common(10)
|
||||
[('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),
|
||||
('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue