Skip to content
Snippets Groups Projects
Commit 63afc856 authored by Dominik Zobel's avatar Dominik Zobel
Browse files

Move Python error messages on the same slide with code

parent a3066370
No related branches found
No related tags found
1 merge request!56Debugging Strategies lecture notes
......@@ -101,7 +101,7 @@ int main() {
:::
:::{.column width=50%}
:::{.column width=50% .fragment}
- Compilation only throws a warning
```
......@@ -127,7 +127,11 @@ Aborted
::::::::
## Locating the right error message (1/2) {.leftalign}
## Locating the right error message {.leftalign}
::::::::{.columns .smaller}
:::{.column width=50%}
```python
def _extend_number(num):
......@@ -145,35 +149,35 @@ def extend_number(num):
print(extend_number('6'))
```
:::{.smaller}
Expected output:
:::
```
6543210
```
:::
## Locating the right error message (2/2)
:::{.column width=50% .fragment}
Output from previous code (last 15 lines)
```
During handling of the above exception, another exception occurred:
Actual output (last 17 lines)
```
Traceback (most recent call last):
File "<stdin>", line 3, in extend_number
File "number_extension.py", line 6, in extend_number
for idx in range(num):
RecursionError: maximum recursion depth exceeded while calling a Python object
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 6, in extend_number
File "<stdin>", line 6, in extend_number
File "<stdin>", line 6, in extend_number
File "number_extension.py", line 13, in <module>
print(extend_number('6'))
File "number_extension.py", line 9, in extend_number
num = extend_number(num)
File "number_extension.py", line 9, in extend_number
num = extend_number(num)
File "number_extension.py", line 9, in extend_number
num = extend_number(num)
[Previous line repeated 996 more times]
RecursionError: maximum recursion depth exceeded
```
......@@ -182,10 +186,14 @@ RecursionError: maximum recursion depth exceeded
issues in line 9 and 13
-->
:::
::::::::
## Hands-On! {.handson}
1. What are the actual issues in the code from the previous slides based on the error messages?
1. What are the actual issues in the code from the previous slide based on the error messages?
2. How to rectify them?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment