Module 3: Error Handling and Debugging
Module 3 focused on debugging Python scripts. The lab taught me how to identify syntax, runtime and file path-related errors while improving my understanding of troubleshooting techniques and exception handling. Three scripts were successfully debugged. Script 1 For the first script, I first received a name error stating that ‘fc’ is not defined. To fix this, I changed it to ‘FC’. The second error I received was another Name error stating that field is not defined. To fix this error, I switched ‘fields’ to ‘field’. The script then ran successfully, as shown above. Script 2 The first error received on the second script was a syntax warning on line 15, saying there was an invalid escape sequence (/p). To fix this, I simply fixed the backslash to the proper form. The second error was a name error on line 14, stating that ‘Filepath’ was not described. To fix this, I just had to change ‘Filepath’ to ‘filepath’ because Python is case-sensitive. The third error encounte...