Module Three pertained to Python scripting debugging and error handling. I was initially intimidated by this week's assignment. However, I remembered how time consuming last week's assignment was due to my overthinking things and focused on the small details (rather than the big picture). As such, I completed all portions of this lab in a reasonable time frame and believe that I grasped all concepts well. I also became more proficient in spotting errors in Python code.
Script 1 Result:
With regard to Script 3, we were
asked not to correct any of the errors in the code, but utilize a
"Try-Except" statement, which would allow the script to run
successfully. even when there were errors in the code. Python scripts will not
run if errors (or exception) occur, which is why it is necessary for us to
learn how to bypass some of the errors to run the entire script. This portion
of the lab was more time consuming that Scripts 2 and 3, mainly because I did
not initially understand the concept at first.
But, after I ran scripts in the Lab Exercise, and read more about the
concept, I was able to understand it.
Simply put, the programmer should put the "Try:" statement on
the code they would like to "try out" and then put the
"Except" statement after the lines of code that the programmer would
like to "try" and look for errors. The programmer should be sure to
modules that they would need prior to inserting the "try" statement.
Below, I have posted a general flow chart for the Try-Except Clause.
Script 3 Result:
Script 3 Flowchart ("Try-Except Clause"):
No comments:
Post a Comment