Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions regexes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -31,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -47,7 +47,7 @@
" ['And', 'dread', 'avenging', 'Phœbus', 'son', 'of', 'Jove']]"
]
},
"execution_count": 38,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -95,6 +95,31 @@
"\n",
"Using the code above as a guide, get the counts for _every_ word in `sample_text`."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"64"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"every_word = 0\n",
"for line in lines:\n",
" for word in line:\n",
" every_word += 1\n",
"\n",
"every_word"
]
}
],
"metadata": {
Expand Down