My First Python Errors
My first experience deliberately creating errors in Python was quite straightforward. I created two errors in the same file: a SyntaxError and a NameError.
For the SyntaxError, I left out the closing quotation mark in one of my print() statements. I also created a NameError by changing the lowercase “n” in print to a capital “N”.
When I tried to run the file using Python 3, it first displayed a SyntaxError. Python started reading the code from the top and detected the first error before it could get to the second one. After correcting the missing quotation mark, I ran the file again, and it displayed the NameError. I corrected the capital letter in print and ran the file once more. Everything worked perfectly.
One thing I learned from this exercise is that Python reports errors as it encounters them, so correcting the first error can reveal another one. I didn't find the process confusing because the videos and learning materials were very explanatory. They made it easier to understand what went wrong and how to fix it.
Overall, it was a good learning experience, and I'm grateful for the materials that made the process easier.
