Skip to content

Commit 58a07c6

Browse files
committed
Review
1 parent fc13053 commit 58a07c6

5 files changed

Lines changed: 37 additions & 24 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ open:
1616
open docs/_build/index.html
1717

1818
open-pdf:
19-
open docs/_build/Intro-to-Python-Programming-And-Applications.pdf
19+
open docs/_build/Intro-to-Python--Programming-And-Applications.pdf
2020

2121
clean:
2222
rm -rf docs/_build

docs/notes/fetching-data/http.qmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ In HTTP, there are certain types of requests that we can make, each for its own
9191

9292
Request Method | Purpose
9393
--- | ---
94-
GET | Request to receive some information from the server
95-
POST | Request to create some information on the server
96-
PUT/PATCH | Request to update some information on the server
97-
DELETE | Request to remove some information from the server
94+
GET | Request to receive some information from the server.
95+
POST | Request to create some information on the server.
96+
PUT/PATCH | Request to update some information on the server.
97+
DELETE | Request to remove some information from the server.
9898

9999
: Table 2: HTTP Request Methods {.striped .hover}
100100

docs/notes/python-lang/basic-datatypes/index.qmd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Basic (\"scalar\") datatypes that involve a single value:
3737
| [String](./strings.qmd) | Textual data, within quotes. | `"HELLO WORLD"` |
3838
| [None Type](https://docs.python.org/3/library/constants.html#None) | Absence of a value, or a "null" value. | `None` only |
3939

40+
: Table 1: Basic "Scalar" Datatypes {.striped .hover tbl-colwidths="[10,55,35]"}
41+
4042
#### Container Datatypes
4143

4244
\"Container\" datatypes that can hold many values:
@@ -48,6 +50,7 @@ Basic (\"scalar\") datatypes that involve a single value:
4850
| [Set](https://docs.python.org/3/tutorial/datastructures.html#sets) | Like a list, but without a particular order, and cannot contain duplicates. | `{5, 3, 1}`|
4951
| [<span style="white-space:nowrap;">Dictionary</span>](../container-datatypes/dictionaries.qmd) | An object with named attributes, otherwise known as "key value pairs". | `{"first_name": "Michael", "last_name": "Jordan"}` |
5052

53+
: Table 2: Container Datatypes {.striped .hover tbl-colwidths="[10,55,35]"}
5154

5255

5356
## Why Datatypes Matter
@@ -160,7 +163,7 @@ print(type(result))
160163
print(result)
161164
```
162165
```{python}
163-
result = set([5, 3, 1, 3, 7]) # set conversion will remove duplicates from the list
166+
result = set([5, 3, 1, 3, 7]) # set conversion will remove duplicates
164167
print(type(result))
165168
print(result)
166169
```

docs/notes/python-lang/control-flow/custom-functions.qmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ A function may accept input arguments called **parameters** which are essentiall
5151
def display_heading(message):
5252
print("------------------")
5353
print(message.upper())
54-
print("------------------")
5554
5655
5756
# FUNCTION INVOCATIONS:

docs/notes/python-lang/control-flow/errors.qmd

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ If we find the need to trigger our own errors to stop program execution (less co
5858
```python
5959
options = ["rock", "paper", "scissors"]
6060

61-
choice = "hoya" # input("Please choose either 'rock', 'paper', or 'scissors': ")
61+
choice = "hoya"
6262

6363
if choice not in options:
6464
raise ValueError("OOPS - Please type 'rock', or 'paper', or 'scissors'.")
65+
#> ValueError
6566
```
6667

6768
### Defining and Raising Custom Errors
@@ -73,49 +74,59 @@ class MyCustomError(Exception):
7374
pass
7475

7576
raise MyCustomError("My custom message")
77+
#> MyCustomError
7678
```
7779

7880
## Common Errors and Explanations
7981

8082
### Syntax Error
8183

82-
A `SyntaxError` occurs when the code is not written correctly according to the rules of the Python language. This can happen due to missing colons, parentheses, or incorrect indentation.
84+
A `SyntaxError` occurs when the code is not written correctly according to the rules of the Python language.
85+
86+
This can happen due to missing colons, parentheses, or incorrect indentation:
8387

84-
Example:
8588
```python
86-
# Missing colon
87-
if True
88-
print("This will cause a SyntaxError")
89+
if True # OOPS, MISSING A COLON
90+
print("Yep")
91+
92+
#> SyntaxError
8993
```
9094

9195
### Value Error
9296

93-
A `ValueError` occurs when a function receives an argument of the correct type but an inappropriate value. This can happen when trying to convert a string to an integer, but the string does not represent a number.
97+
A `ValueError` occurs when a function receives an argument of the correct type but an inappropriate value.
98+
99+
This can happen when trying to convert a string to an integer, but the string does not represent a number:
94100

95101
Example:
96102
```python
97-
# Trying to convert a non-numeric string to an integer
98-
int("hello") # This will cause a ValueError
103+
int("hello") # OOPS, INVALID CONVERSION
104+
105+
#> ValueError
99106
```
100107

101108
### Key Error
102109

103-
A `KeyError` occurs when trying to access a dictionary with a key that does not exist. This can happen when trying to retrieve a value from a dictionary using a key that is not present.
110+
A `KeyError` occurs when trying to access a dictionary with a key that does not exist.
111+
112+
This can happen when trying to retrieve a value from a dictionary using a key that is not present:
104113

105-
Example:
106114
```python
107-
# Accessing a non-existent key in a dictionary
108115
my_dict = {"name": "Alice"}
109-
print(my_dict["age"]) # This will cause a KeyError
116+
print(my_dict["age"]) # OOPS, "AGE" IS NOT A KEY!
117+
118+
#> KeyError
110119
```
111120

112121
### Index Error
113122

114-
An `IndexError` occurs when trying to access an index that is out of range for a list or other sequence. This can happen when trying to access an element at an index that does not exist.
123+
An `IndexError` occurs when trying to access an index that is out of range for a list or other sequence.
124+
125+
This can happen when trying to access an element at an index that does not exist:
115126

116-
Example:
117127
```python
118-
# Accessing an index that is out of range
119128
my_list = [1, 2, 3]
120-
print(my_list[5]) # This will cause an IndexError
129+
print(my_list[5]) # OOPS, INDEX OUT OF RANGE!
130+
131+
#> IndexError
121132
```

0 commit comments

Comments
 (0)