Skip to content

Commit 8cadf5b

Browse files
author
Nathan Parsons
committed
Regenerate README to include exceptions section
1 parent 15fb91e commit 8cadf5b

File tree

105 files changed

+1667
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1667
-68
lines changed

exercises/accumulate/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ Keep your hands off that collect/map/fmap/whatchamacallit functionality
2525
provided by your standard library!
2626
Solve this one yourself using other basic tools instead.
2727

28+
## Exception messages
29+
30+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
31+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
32+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
33+
a message.
34+
35+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
36+
`raise Exception`, you shold write:
37+
38+
```python
39+
raise Exception("Meaningful message indicating the source of the error")
40+
```
41+
42+
2843
## Submitting Exercises
2944

3045
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/acronym/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ Techies love their TLA (Three Letter Acronyms)!
77
Help generate some jargon by writing a program that converts a long name
88
like Portable Network Graphics to its acronym (PNG).
99

10+
## Exception messages
11+
12+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
13+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
14+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
15+
a message.
16+
17+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
18+
`raise Exception`, you shold write:
19+
20+
```python
21+
raise Exception("Meaningful message indicating the source of the error")
22+
```
23+
24+
1025
## Submitting Exercises
1126

1227
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/all-your-base/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ I think you got the idea!
3131

3232
*Yes. Those three numbers above are exactly the same. Congratulations!*
3333

34+
## Exception messages
35+
36+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
37+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
38+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
39+
a message.
40+
41+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
42+
`raise Exception`, you shold write:
43+
44+
```python
45+
raise Exception("Meaningful message indicating the source of the error")
46+
```
47+
48+
3449
## Submitting Exercises
3550

3651
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/allergies/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ allergens that score 256, 512, 1024, etc.). Your program should
2929
ignore those components of the score. For example, if the allergy
3030
score is 257, your program should only report the eggs (1) allergy.
3131

32+
## Exception messages
33+
34+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
35+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
36+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
37+
a message.
38+
39+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
40+
`raise Exception`, you shold write:
41+
42+
```python
43+
raise Exception("Meaningful message indicating the source of the error")
44+
```
45+
46+
3247
## Submitting Exercises
3348

3449
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/alphametics/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ a multi-digit number must not be zero.
3131

3232
Write a function to solve alphametics puzzles.
3333

34+
## Exception messages
35+
36+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
37+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
38+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
39+
a message.
40+
41+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
42+
`raise Exception`, you shold write:
43+
44+
```python
45+
raise Exception("Meaningful message indicating the source of the error")
46+
```
47+
48+
3449
## Submitting Exercises
3550

3651
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/anagram/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ Given `"listen"` and a list of candidates like `"enlists" "google"
66
"inlets" "banana"` the program should return a list containing
77
`"inlets"`.
88

9+
## Exception messages
10+
11+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
12+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
13+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
14+
a message.
15+
16+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
17+
`raise Exception`, you shold write:
18+
19+
```python
20+
raise Exception("Meaningful message indicating the source of the error")
21+
```
22+
23+
924
## Submitting Exercises
1025

1126
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/atbash-cipher/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ things based on word boundaries.
2828
- Decoding `gvhg` gives `test`
2929
- Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog`
3030

31+
## Exception messages
32+
33+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
34+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
35+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
36+
a message.
37+
38+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
39+
`raise Exception`, you shold write:
40+
41+
```python
42+
raise Exception("Meaningful message indicating the source of the error")
43+
```
44+
45+
3146
## Submitting Exercises
3247

3348
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/beer-song/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Beer Song
22

3-
Produce the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall.
3+
Recite the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall.
44

55
Note that not all verses are identical.
66

@@ -320,6 +320,21 @@ are some additional things you could try:
320320
Then please share your thoughts in a comment on the submission. Did this
321321
experiment make the code better? Worse? Did you learn anything from it?
322322

323+
## Exception messages
324+
325+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
326+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
327+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
328+
a message.
329+
330+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
331+
`raise Exception`, you shold write:
332+
333+
```python
334+
raise Exception("Meaningful message indicating the source of the error")
335+
```
336+
337+
323338
## Submitting Exercises
324339

325340
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/binary-search-tree/README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,20 @@ And if we then added 1, 5, and 7, it would look like this
5353
/ \ / \
5454
1 3 5 7
5555

56+
## Exception messages
57+
58+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
59+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
60+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
61+
a message.
62+
63+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
64+
`raise Exception`, you shold write:
65+
66+
```python
67+
raise Exception("Meaningful message indicating the source of the error")
68+
```
69+
5670

5771
## Submitting Exercises
5872

@@ -65,7 +79,7 @@ please see the [help page](http://exercism.io/languages/python).
6579

6680
## Source
6781

68-
Wikipedia [https://en.wikipedia.org/wiki/Binary_search_tree](https://en.wikipedia.org/wiki/Binary_search_tree)
82+
Josh Cheek [https://twitter.com/josh_cheek](https://twitter.com/josh_cheek)
6983

7084
## Submitting Incomplete Solutions
71-
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
85+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

exercises/binary-search/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ A binary search halves the number of items to check with each iteration,
3434
so locating an item (or determining its absence) takes logarithmic time.
3535
A binary search is a dichotomic divide and conquer search algorithm.
3636

37+
## Exception messages
38+
39+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
40+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
41+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
42+
a message.
43+
44+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
45+
`raise Exception`, you shold write:
46+
47+
```python
48+
raise Exception("Meaningful message indicating the source of the error")
49+
```
50+
51+
3752
## Submitting Exercises
3853

3954
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/binary/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ Binary is similar, but uses powers of 2 rather than powers of 10.
3030

3131
So: `101 => 1*2^2 + 0*2^1 + 1*2^0 => 1*4 + 0*2 + 1*1 => 4 + 1 => 5 base 10`.
3232

33+
## Exception messages
34+
35+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
36+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
37+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
38+
a message.
39+
40+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
41+
`raise Exception`, you shold write:
42+
43+
```python
44+
raise Exception("Meaningful message indicating the source of the error")
45+
```
46+
47+
3348
## Submitting Exercises
3449

3550
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/bob/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ anything.
1111

1212
He answers 'Whatever.' to anything else.
1313

14+
## Exception messages
15+
16+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
17+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
18+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
19+
a message.
20+
21+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
22+
`raise Exception`, you shold write:
23+
24+
```python
25+
raise Exception("Meaningful message indicating the source of the error")
26+
```
27+
28+
1429
## Submitting Exercises
1530

1631
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/book-store/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,21 @@ For a total of $51.20
6767

6868
And $51.20 is the price with the biggest discount.
6969

70+
## Exception messages
71+
72+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
73+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
74+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
75+
a message.
76+
77+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
78+
`raise Exception`, you shold write:
79+
80+
```python
81+
raise Exception("Meaningful message indicating the source of the error")
82+
```
83+
84+
7085
## Submitting Exercises
7186

7287
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/bracket-push/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
Given a string containing brackets `[]`, braces `{}` and parentheses `()`,
44
verify that all the pairs are matched and nested correctly.
55

6+
## Exception messages
7+
8+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
9+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
10+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
11+
a message.
12+
13+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
14+
`raise Exception`, you shold write:
15+
16+
```python
17+
raise Exception("Meaningful message indicating the source of the error")
18+
```
19+
20+
621
## Submitting Exercises
722

823
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/change/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ that the sum of the coins' value would equal the correct amount of change.
1616
- Can you ask for negative change?
1717
- Can you ask for a change value smaller than the smallest coin value?
1818

19+
## Exception messages
20+
21+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
22+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
23+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
24+
a message.
25+
26+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
27+
`raise Exception`, you shold write:
28+
29+
```python
30+
raise Exception("Meaningful message indicating the source of the error")
31+
```
32+
33+
1934
## Submitting Exercises
2035

2136
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/circular-buffer/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,21 @@ the buffer is once again full.
5050

5151
[D][7][8][9][A][B][C]
5252

53+
## Exception messages
54+
55+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
56+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
57+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
58+
a message.
59+
60+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
61+
`raise Exception`, you shold write:
62+
63+
```python
64+
raise Exception("Meaningful message indicating the source of the error")
65+
```
66+
67+
5368
## Submitting Exercises
5469

5570
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

exercises/clock/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ You should be able to add and subtract minutes to it.
66

77
Two clocks that represent the same time should be equal to each other.
88

9+
## Exception messages
10+
11+
Sometimes it is necessary to raise an exception. When you do this, you should include a meaningful error message to
12+
indicate what the source of the error is. This makes your code more readable and helps significantly with debugging. Not
13+
every exercise will require you to raise an exception, but for those that do, the tests will only pass if you include
14+
a message.
15+
16+
To raise a message with an exception, just write it as an argument to the exception type. For example, instead of
17+
`raise Exception`, you shold write:
18+
19+
```python
20+
raise Exception("Meaningful message indicating the source of the error")
21+
```
22+
23+
924
## Submitting Exercises
1025

1126
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

0 commit comments

Comments
 (0)