Real Python Tutorials

LBYL vs EAFP: Preventing or Handling Errors in Python
NEW

Handling or Preventing Errors in Python: LBYL vs EAFP

In this video course, you'll learn about two popular coding styles in Python: look before you leap (LBYL) and easier to ask forgiveness than permission (EAFP). You can use these styles to deal with errors & exceptional situations in your code. You'll dive into the LBYL vs EAFP discussion in Python.

Dec 03, 2024 intermediate best-practices python