Now you know that Python has the look before you leap (LBYL) and easier to ask forgiveness than permission (EAFP) coding styles, which are general strategies to deal with errors and exceptional situations in your code. You’ve also learned what these coding styles are and how to use them in your code.
In this video course, you’ve learned:
- The basics of Python’s LBYL and EAFP coding styles
- The pros and cons of LBYL vs EAFP in Python
- The keys to deciding when to use either LBYL or EAFP
With this knowledge about Python’s LBYL and EAFP coding styles, you’re now able to decide which strategy to use when you’re dealing with errors and exceptional situations in your code.
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.