Python Programming: Lesson 17 - Identifying and Raising Exceptions

Publicado el: 17 agosto 2021
en el canal de: youmils03
63
0

PLEASE SUBSCRIBE!!!

In the previous lesson (   • Python Programming: Lesson 16 - Modules  ), we studied modules in Python. Here, we look at some more modules but then turn our attention to exceptions. Handling exceptions is further explored in the next lesson.

Recall that a module is a package of code that someone has written, providing useful functions and constants that we can use inside our programs. All we have to do is import at the top of our program

To use a function F( ) from a module M
import M, then call M.F( )
from M import F, then call F( )
from M import F as G, then call G( )

[Not talked about in this video, but you can actually import a module and call it a different name in your program. import M as N, then call N.F( ). Can learn about it here    / pd5twn4vwmw  ]

An exception is a runtime error that occurs in our code. We can have:

organic exceptions - runtime errors caused by unintentional faults in our code
engineered exceptions - when we choose to manually throw a runtime error
handled exceptions - successful code that prevents a runtime error using a try/except block

We talk in this video about several types of errors in Python. Here are some of them

0:35 Review of Importing and Using Modules
2:34 Review of Importing Specific Functions from a Module
4:44 Review of Calling Imported Functions by Other Names
6:45 More Review of Modules (random Module)
8:42 NEW: Intro to Exceptions
9:59 NEW: Types of Exceptions
17:18 NEW: Raising Exceptions

An equivalent Java lesson is available here:    • Java Programming: Lesson 44 - Throwing Exc...  

Ready to figure out how to handle exceptions? Check out lesson 18:    • Python Programming: Lesson 18 - Catching a...  

Thanks for watching, and PLEASE SUBSCRIBE!!!


En esta página del sitio puede ver el video en línea Python Programming: Lesson 17 - Identifying and Raising Exceptions de Duración hora minuto segunda en buena calidad , que subió el usuario youmils03 17 agosto 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 63 veces y le gustó 0 a los espectadores. Disfruta viendo!