Solves the issue of python raising an exception when calling int() on an object that can't be converted to an int, The while loop is so that the user has to input an option or close the program. The problem with just doing a general try: except: clause is that other errors that you may not want to catch can be included such as someone attempting to control + c out of the program inside of the terminal. That being said it is possible to write this main menu in cleaner code I can attempt an example later if you would like.
Solves the issue of python raising an exception when calling int() on an object that can't be converted to an int, The while loop is so that the user has to input an option or close the program. The problem with just doing a general try: except: clause is that other errors that you may not want to catch can be included such as someone attempting to control + c out of the program inside of the terminal. That being said it is possible to write this main menu in cleaner code I can attempt an example later if you would like.