Companies Home Search Profile

Raising and Handling Python Exceptions

Focused View

Martin Breuss

33:42

281 View
  • 507-00-overview.mp4
    02:02
  • 507-01-differentiating.mp4
    03:44
  • 507-02-raise-exception.mp4
    05:36
  • 507-03-assert.mp4
    04:27
  • 507-04-try-except.mp4
    05:47
  • 507-05-else.mp4
    03:21
  • 507-06-built-in.mp4
    03:25
  • 507-07-finally.mp4
    02:50
  • 507-08-summary.mp4
    02:30
  • exceptions.pdf
  • exceptions course sample code.zip
  • Description


    A Python program terminates as soon as it encounters an error. In Python, an error can be a syntax error or an exception.

    In this course, you’ll learn what an exception is and how it differs from a syntax error. After that, you’ll learn about raising exceptions and making assertions. Then, you’ll learn how to catch exceptions to prevent your program from unintentionally ending and to change the control flow of your program:

    You’ll learn about the basic use of a try … except block, as well as how to extend it using else and finally.

    What You'll Learn?


    • Differentiate exceptions from syntax errors
    • Use the assert keyword to check if a certain condition is met
    • Write custom exceptions that subclass Exception
    • Catch exceptions with a tryexcept block
    • Use the additional keywords else and finally
    • Catch built-in exceptions

    More details


    User Reviews
    Rating
    0
    0
    0
    0
    0
    average 0
    Total votes0
    Focused display
    Category
    Martin Breuss
    Martin Breuss
    Instructor's Courses

    As someone who learned programming primarily through online resources, I feel that I have a good understanding of how important high quality learning material is.

    With a background in education, I worked as a coding mentor, code reviewer, curriculum developer, and bootcamp instructor. Quality education and figuring out how to have fun while learning unfamiliar topics effectively has always been a big topic in my life. Real Python provides all that, and I’m happy that I can contribute.

    In my day job I create online courses and teach on-site bootcamps around the world with CodingNomads. This position keeps me traveling, teaching, learning, discovering new places and new aspects of Python, as well as getting to know interesting and motivated students year-round.

    When you learn to program, you’re learning to instruct a universal tool. People have described programming as the literacy of the 21st century, and I think that there’s something to that idea.

    That doesn’t mean that you need to become a full-time software developer to apply your programming skills productively. Most likely there is way how your interests can benefit from being able to skillfully instruct your personal universal tool. And Python is a great language to get started with and also to keep going.

    I’m happy to help out with thoughts and resources as well as encouragement.

    If you’re stuck, remember that everyone gets stuck and if you feel you don’t know much, keep in mind that most of us feel that way quite often. Take a break, maybe go on a walk outside or do what it takes for you to keep yourself feeling good.

    It’s easier to stick with something for the long term when you’re finding enjoyment in what you do. Remember that learning anything new is more of a marathon than a sprint. :)

    Learn Python online: Python tutorials for developers of all skill levels, Python books and courses, Python news, code examples, articles, and more.
    • language english
    • Training sessions 9
    • duration 33:42
    • Release Date 2023/01/05