Python Classroom Series – 25/Sept/2020

Exceptions in Python

  • We play dual roles
    • Library Creator: We want our functions/methods etc.. to be used effectively. Here we raise exceptions
    • Library User: We handle exceptions
  • LBYL (Look before you leap): We will check for all the preconditions and try to use in the correct way
  • EAFP (Easier to Ask forgiveness than permission)
    • Python promotes this approach
    • Handle exceptions
  • Python official Docs for Errors & Exceptions Refer Here
  • Refer Here for the approach followed in Exception handling
  • Exceptions Handling in python & Creating A custom Exceptions:

LT Restaurant feature

  • As of now we are able to add or update items, but we are unable to delete them
  • Once the application is stopped & started again MenuItems are lost, Every time user has to enter the menu.
  • Now to implement this feature our dev team wants to store the menu items in a file Preview
  • Once we store the menu items ina file, even after restarts we should be able to view menu
  • Next Steps:
    1. Implement file handling to save menu items

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin