Day 28

On day 28 I did some more work with tkinter but also decided on starting early with error handling as that’s very important imho.


error handling can have multiple excepts

try:    #tries to do something

except specificError:    #if some specific error happens

except anotherError as error_message: # if another error happens
    print(f"Some error including {error_message} and more text")

else: # if the try succeeds and only then
finally:   #runs no matter what happens

raise exceptions

raise TypeError or KeyError with ("a message")


Comments are closed.