How To Use Try / Except Commands In Python

Python has a ton of built in functionality, and one of my favorite commands within Python is Try / Except. These commands allow us to try a certain block of code, if that code doesn’t work it can print out an error. Here is a little breakdown of this functionality:

try:
#PUT THE CDOE TO TRY HERE
except:
#IF THE CODE FAILS, DO THIS INSTEAD

These commands are extremely important, in my experience whenever i’ve built out an application and a certain portion didn’t work within the code, the whole program wouldn’t open / the…