Skip to content

Commit a61a8f6

Browse files
committed
fix chapter headings
1 parent e1d88ca commit a61a8f6

11 files changed

+50
-44
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ _site
99
.project
1010
.pydevproject
1111
.settings/
12+
_build

01_basics.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"This notebook is based on materials kindly provided by the [IN1900]( https://www.uio.no/studier/emner/matnat/ifi/IN1900/h19/) team.\n",
7+
"# The Basics: Variables and Printing\n",
88
"\n",
9-
"# Introduction\n",
9+
"This notebook is based on materials kindly provided by the [IN1900]( https://www.uio.no/studier/emner/matnat/ifi/IN1900/h19/) team.\n",
1010
"\n",
1111
"Programming is a way of telling the computer what to do.\n",
1212
"Computer programs are a kind of recipe, like cooking or knitting recipes.\n",
@@ -20,7 +20,7 @@
2020
"cell_type": "markdown",
2121
"metadata": {},
2222
"source": [
23-
"# Python as a Calculator \n",
23+
"## Python as a Calculator \n",
2424
"You can do simple math like this:\n",
2525
"\n",
2626
"- $a + b$ in Python : `a + b`\n",
@@ -65,7 +65,7 @@
6565
"cell_type": "markdown",
6666
"metadata": {},
6767
"source": [
68-
"# Printing to the Screen (Terminal)\n",
68+
"## Printing to the Screen (Terminal)\n",
6969
"\n",
7070
"As we can see above, Jupyter Notebook only displays the value of the final expression in a cell.\n",
7171
"If you want to see the value of other expressions, you need to print them to the screen.\n",
@@ -136,7 +136,7 @@
136136
"cell_type": "markdown",
137137
"metadata": {},
138138
"source": [
139-
"# Variables\n",
139+
"## Variables\n",
140140
"\n",
141141
"In the examples above, the computer \"forgets\" the information as soon as it has been printed.\n",
142142
"We need some way to store information in our program. This is what variables are for.\n",
@@ -334,7 +334,7 @@
334334
"cell_type": "markdown",
335335
"metadata": {},
336336
"source": [
337-
"# Data types\n",
337+
"## Data types\n",
338338
"\n",
339339
"Variables can be of different types besides whole numbers (integers).\n",
340340
"We will look at some of the types in Python. You can use the function `type()`to find the type of a variable."
@@ -478,7 +478,7 @@
478478
"cell_type": "markdown",
479479
"metadata": {},
480480
"source": [
481-
"# Importing Libraries/Modules\n",
481+
"## Importing Libraries/Modules\n",
482482
"\n",
483483
"A module is a collection of functions that someone has written. A library is a collection of modules.\n",
484484
"There are innumerable python libraries available for performing diverse tasks.\n",
@@ -554,7 +554,7 @@
554554
"cell_type": "markdown",
555555
"metadata": {},
556556
"source": [
557-
"# Commenting Code\n",
557+
"## Commenting Code\n",
558558
"\n",
559559
"Comments can make your code easier to understand. You can use a `#` character to start a single line comment. \n",
560560
"To write a comment consisting of multiple lines, you use three quotes `'''` before and after the comment."
@@ -584,7 +584,7 @@
584584
"cell_type": "markdown",
585585
"metadata": {},
586586
"source": [
587-
"# <span style=\"color:blue\">Key Points</span>\n",
587+
"## <span style=\"color:blue\">Key Points</span>\n",
588588
"\n",
589589
"- Use `variable = value` to assign a value to the variable to store it for later use\n",
590590
"- Use `print(something)` to show the value of `something`.\n",
@@ -609,7 +609,7 @@
609609
"name": "python",
610610
"nbconvert_exporter": "python",
611611
"pygments_lexer": "ipython3",
612-
"version": "3.7.7"
612+
"version": "3.7.10"
613613
}
614614
},
615615
"nbformat": 4,

02_lists_loops.ipynb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7+
"# Lists and Loops\n",
8+
"\n",
79
"This notebook is based on materials kindly provided by the [IN1900]( https://www.uio.no/studier/emner/matnat/ifi/IN1900/h19/) team.\n",
810
"\n",
9-
"# Lists\n",
11+
"## Lists\n",
1012
"\n",
1113
"Python lists can contain `int`, `float`, `String` and other items.\n",
1214
"We make a list by placing the items in square brackets, `[]`, separated by commas."
@@ -44,7 +46,7 @@
4446
"cell_type": "markdown",
4547
"metadata": {},
4648
"source": [
47-
"### Adding (Appending) Elements to a List\n",
49+
"## Adding (Appending) Elements to a List\n",
4850
"\n",
4951
"We can add/append elements to an existing list. Below we first make an empty list, and then append one element at a time using `append()`. Note that `append()` adds items at the end of the list."
5052
]
@@ -109,7 +111,7 @@
109111
"cell_type": "markdown",
110112
"metadata": {},
111113
"source": [
112-
"### Accessing List Elements - List Indexing\n",
114+
"## Accessing List Elements - List Indexing\n",
113115
"\n",
114116
"To get an item from a list, we use an index number. \n",
115117
"\n",
@@ -179,7 +181,7 @@
179181
"cell_type": "markdown",
180182
"metadata": {},
181183
"source": [
182-
"### Making a List of Lists \n",
184+
"## Making a List of Lists \n",
183185
"\n",
184186
"Now, we can make a new list containing the lists `odd` and `even`."
185187
]
@@ -229,7 +231,7 @@
229231
"cell_type": "markdown",
230232
"metadata": {},
231233
"source": [
232-
"# Loops\n",
234+
"## Loops\n",
233235
"\n",
234236
"We saw above how we could manually get each element in a list. However, this kind of repetition is tedious and error-prone. For example, if we change ```odd``` to be a shorter list, we will get an error when re-running the code we wrote above:"
235237
]
@@ -503,7 +505,7 @@
503505
"cell_type": "markdown",
504506
"metadata": {},
505507
"source": [
506-
"# <span style=\"color:blue\">Key Points</span>\n",
508+
"## <span style=\"color:blue\">Key Points</span>\n",
507509
"\n",
508510
"- We can make lists of items\n",
509511
"- We use indexes to access items in lists: `things[3]` or `many_things[0][4]`\n",
@@ -528,7 +530,7 @@
528530
"name": "python",
529531
"nbconvert_exporter": "python",
530532
"pygments_lexer": "ipython3",
531-
"version": "3.7.7"
533+
"version": "3.7.10"
532534
}
533535
},
534536
"nbformat": 4,

03_Dictionaries.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"This notebook is based on materials kindly provided by the [IN1900]( https://www.uio.no/studier/emner/matnat/ifi/IN1900/h19/) team.\n",
8-
"\n",
97
"# Dictionaries \n",
108
"\n",
9+
"This notebook is based on materials kindly provided by the [IN1900]( https://www.uio.no/studier/emner/matnat/ifi/IN1900/h19/) team.\n",
10+
"\n",
1111
"Dictionaries are lookup tables.\n",
1212
"We can use dictionaries to store and look up information.\n",
1313
"Rather than numerical indexes, a dictionary assigns a *key* to each stored *value*.\n",
@@ -95,7 +95,7 @@
9595
"cell_type": "markdown",
9696
"metadata": {},
9797
"source": [
98-
"### Iterating Over Dictionaries\n",
98+
"## Iterating Over Dictionaries\n",
9999
"\n",
100100
"When you iterate over dictionary, you iterate over the *keys* not the *values*."
101101
]
@@ -115,7 +115,7 @@
115115
"cell_type": "markdown",
116116
"metadata": {},
117117
"source": [
118-
"### Is this Key in the Dictionary?\n",
118+
"## Is this Key in the Dictionary?\n",
119119
"\n",
120120
"We can check for the presence of a key with the Boolean expression\n",
121121
"`key in dictionary`.\n",
@@ -239,7 +239,7 @@
239239
"cell_type": "markdown",
240240
"metadata": {},
241241
"source": [
242-
"# <span style=\"color:blue\">Key Points</span>\n",
242+
"## <span style=\"color:blue\">Key Points</span>\n",
243243
"\n",
244244
"- A dictionary links *values* to *keys*: `phone_directory[\"Alice\"]`\n",
245245
"- Keys are usually strings, values can be any object\n",
@@ -263,7 +263,7 @@
263263
"name": "python",
264264
"nbconvert_exporter": "python",
265265
"pygments_lexer": "ipython3",
266-
"version": "3.7.7"
266+
"version": "3.7.10"
267267
}
268268
},
269269
"nbformat": 4,

04_caselaw.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Working with JSON Data From a Server\n",
7+
"# JSON and Case Law\n",
88
"\n",
99
"How can we extract data from APIs (machine-readable online data sources)?\n",
1010
"\n",
@@ -348,7 +348,7 @@
348348
"cell_type": "markdown",
349349
"metadata": {},
350350
"source": [
351-
"# <span style=\"color:blue\">Key Points</span>\n",
351+
"## <span style=\"color:blue\">Key Points</span>\n",
352352
"\n",
353353
"- The `requests` library can be used to fetch data from the web.\n",
354354
"- Many data providers provide an API from which we can fetch data programatically.\n",
@@ -374,7 +374,7 @@
374374
"name": "python",
375375
"nbconvert_exporter": "python",
376376
"pygments_lexer": "ipython3",
377-
"version": "3.7.7"
377+
"version": "3.7.10"
378378
}
379379
},
380380
"nbformat": 4,

05_if.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"This notebook is based on materials kindly provided by the [IN1900]( https://www.uio.no/studier/emner/matnat/ifi/IN1900/h19/) team.\n",
7+
"# Decisions\n",
88
"\n",
9-
"# `if`-Tests\n",
9+
"This notebook is based on materials kindly provided by the [IN1900]( https://www.uio.no/studier/emner/matnat/ifi/IN1900/h19/) team.\n",
1010
"\n",
1111
"How can we use Python to automatically recognize different features in our data, and take a different action for each?\n",
1212
"Here, we will learn how to write code that executes only when certain conditions are true.\n",
@@ -292,7 +292,7 @@
292292
"cell_type": "markdown",
293293
"metadata": {},
294294
"source": [
295-
"# <span style=\"color:blue\">Key Points</span>\n",
295+
"## <span style=\"color:blue\">Key Points</span>\n",
296296
"\n",
297297
"- We use `if`-statements to control program flow\n",
298298
"- `if`-statements can have an `else`-part\n",
@@ -317,7 +317,7 @@
317317
"name": "python",
318318
"nbconvert_exporter": "python",
319319
"pygments_lexer": "ipython3",
320-
"version": "3.7.7"
320+
"version": "3.7.10"
321321
}
322322
},
323323
"nbformat": 4,

06_functions.ipynb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"This notebook is based on materials kindly provided by the [IN1900]( https://www.uio.no/studier/emner/matnat/ifi/IN1900/h19/) team.\n",
8-
"\n",
97
"# Functions\n",
108
"\n",
11-
"\n",
9+
"This notebook is based on materials kindly provided by the [IN1900]( https://www.uio.no/studier/emner/matnat/ifi/IN1900/h19/) team.\n",
1210
"\n",
1311
"We have seen how we can use loops to avoid repeating code. This helps us obey the **DRY principle**.\n",
1412
"(Question: what is the DRY principle?)\n",
@@ -336,7 +334,7 @@
336334
"cell_type": "markdown",
337335
"metadata": {},
338336
"source": [
339-
"# <span style=\"color:blue\">Key Points</span>\n",
337+
"## <span style=\"color:blue\">Key Points</span>\n",
340338
"\n",
341339
"- We should make functions to avoid repeating ourselves\n",
342340
"- Functions help us make modular programs\n",
@@ -361,7 +359,7 @@
361359
"name": "python",
362360
"nbconvert_exporter": "python",
363361
"pygments_lexer": "ipython3",
364-
"version": "3.7.7"
362+
"version": "3.7.10"
365363
}
366364
},
367365
"nbformat": 4,

07_Strings.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7+
"# Bonus Episode: Strings\n",
8+
"\n",
79
"This notebook is based on materials kindly provided by the [IN1900]( https://www.uio.no/studier/emner/matnat/ifi/IN1900/h19/) team.\n",
8-
"# Strings\n",
910
"\n",
1011
"Python has many functions for working with strings. We will look at a few of them.\n",
1112
"\n",
@@ -350,7 +351,7 @@
350351
"cell_type": "markdown",
351352
"metadata": {},
352353
"source": [
353-
"# <span style=\"color:blue\">Key Points</span>\n",
354+
"## <span style=\"color:blue\">Key Points</span>\n",
354355
"\n",
355356
"- Strings can be split into lists of words\n",
356357
"- We can use indexes to access individual characters in a String\n",
@@ -374,7 +375,7 @@
374375
"name": "python",
375376
"nbconvert_exporter": "python",
376377
"pygments_lexer": "ipython3",
377-
"version": "3.7.7"
378+
"version": "3.7.10"
378379
}
379380
},
380381
"nbformat": 4,

08_exercises.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# More exercises\n",
7+
"# More Exercises\n",
88
"\n",
99
"Here are extra exercises for the previous parts of the course.\n",
1010
"We encourage you to do them all, to get as much practice as possible."
@@ -52,7 +52,7 @@
5252
"name": "python",
5353
"nbconvert_exporter": "python",
5454
"pygments_lexer": "ipython3",
55-
"version": "3.7.7"
55+
"version": "3.7.10"
5656
}
5757
},
5858
"nbformat": 4,

09_library_data_exercises.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# <span style=\"color:green\"> Exercise: Count Works per Creator </span>\n",
7+
"# Library Data Exercises\n",
8+
"\n",
9+
"## <span style=\"color:green\"> Exercise: Count Works per Creator </span>\n",
810
"\n",
911
"In the JSON book data, each item has a `creator` field located in `metadata`.\n",
1012
"Complete the code below step-by-step to count the number of items per creator.\n",
@@ -66,7 +68,7 @@
6668
"name": "python",
6769
"nbconvert_exporter": "python",
6870
"pygments_lexer": "ipython3",
69-
"version": "3.7.7"
71+
"version": "3.7.10"
7072
}
7173
},
7274
"nbformat": 4,

10_case_law_exercises.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# <span style=\"color:green\"> Exercise: Count Opinions per Author </span>\n",
7+
"# Case Law Exercises\n",
8+
"\n",
9+
"## <span style=\"color:green\"> Exercise: Count Opinions per Author </span>\n",
810
"\n",
911
"In the JSON case law data, each opinion has an `author` field.\n",
1012
"Complete the code below step-by-step to count the number of opinions per author.\n",
@@ -67,7 +69,7 @@
6769
"name": "python",
6870
"nbconvert_exporter": "python",
6971
"pygments_lexer": "ipython3",
70-
"version": "3.7.7"
72+
"version": "3.7.10"
7173
}
7274
},
7375
"nbformat": 4,

0 commit comments

Comments
 (0)