Executing the statement sys.exit(-1) ends execution of the program. No statements in the program file following sys.exit(-1) will be executed. The -1 indicates exiting following an error which we would be doing in this case.
In this program, we want to execute sys.exit(-1) when the file didn't have the art extension and after you print an error message.