Skip to content

Commit 802f47f

Browse files
Week 40
1 parent efc987d commit 802f47f

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

Week40.ipynb

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"## Lecture: Sets\n",
8+
"\n",
9+
"Imagine a set a a bag of items. You can add and remove from that bag but it is **unordered**.\n",
10+
"\n",
11+
"The difference between a set and a list isn't that a set is ordered while a list is. That what makes the set so fast.\n",
12+
"\n",
13+
"A set's three main operations are inserts, deletes, and look ups. Example of a set look up:\n",
14+
"```python\n",
15+
"s = {}\n",
16+
"x = 3 # some arbitrary number\n",
17+
"...\n",
18+
"if (x in s)\n",
19+
" print(\"The value \" + x + \" is in set s\")\n",
20+
"else\n",
21+
" print(\"The value \" + x + \" is not in set s\")\n",
22+
"...\n",
23+
"```\n",
24+
"\n",
25+
"See this [link](https://www.w3schools.com/python/python_sets.asp) for how to use sets in python."
26+
]
27+
}
28+
],
29+
"metadata": {
30+
"kernelspec": {
31+
"display_name": "Python 3.9.13 64-bit",
32+
"language": "python",
33+
"name": "python3"
34+
},
35+
"language_info": {
36+
"name": "python",
37+
"version": "3.9.13"
38+
},
39+
"orig_nbformat": 4,
40+
"vscode": {
41+
"interpreter": {
42+
"hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
43+
}
44+
}
45+
},
46+
"nbformat": 4,
47+
"nbformat_minor": 2
48+
}

0 commit comments

Comments
 (0)