Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Handling or Preventing Errors in Python: LBYL vs EAFP (Summary)

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.

Download

Course Slides (.pdf)

4.8 MB
Download

Sample Code (.zip)

3.0 KB

Become a Member to join the conversation.