Skip to content

Commit c80a7f0

Browse files
committed
Add code to remove all occurrences of number 9 from a list
1 parent ffba4e1 commit c80a7f0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Python_Class.ipynb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,6 +1336,21 @@
13361336
" \n",
13371337
" "
13381338
]
1339+
},
1340+
{
1341+
"cell_type": "code",
1342+
"execution_count": null,
1343+
"metadata": {},
1344+
"outputs": [],
1345+
"source": [
1346+
"ls = [1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8]\n",
1347+
"\n",
1348+
"print(ls)\n",
1349+
"count = ls.count(9)\n",
1350+
"for _ in range(count):\n",
1351+
" ls.remove(9)\n",
1352+
"print(ls)"
1353+
]
13391354
}
13401355
],
13411356
"metadata": {

0 commit comments

Comments
 (0)