In this Python Tutorial for Beginners video I am going to show How to Raise Exceptions in Python.The raise statement allows the programmer to force a specified exception to occur.To Raise an exception, a raise-statement is used to throw a value.When an exception is thrown, the try block stops executing and the Except-block begins execution. This is catching or handling the exception.
First we define classes of exceptions which may be thrown. Upon expected situation, we will throw an exception. we Use the raise statement to generate exceptions.
DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
List of exception in Python
CLASSES object BaseException Exception ArithmeticError FloatingPointError OverflowError ZeroDivisionError AssertionError AttributeError BufferError EOFError ImportError LookupError IndexError KeyError MemoryError NameError UnboundLocalError OSError BlockingIOError ChildProcessError ConnectionError BrokenPipeError ConnectionAbortedError ConnectionRefusedError ConnectionResetError FileExistsError FileNotFoundError InterruptedError IsADirectoryError NotADirectoryError PermissionError ProcessLookupError TimeoutError ReferenceError RuntimeError NotImplementedError RecursionError StopAsyncIteration StopIteration SyntaxError IndentationError TabError SystemError TypeError ValueError UnicodeError UnicodeDecodeError UnicodeEncodeError UnicodeTranslateError Warning BytesWarning DeprecationWarning FutureWarning ImportWarning PendingDeprecationWarning ResourceWarning RuntimeWarning SyntaxWarning UnicodeWarning UserWarning GeneratorExit KeyboardInterrupt
SystemExit
Тэги:
#Python_(Programming_Language) #Python_3.6 #Python #Python_3.x.x #Programming_Language_(Software_Genre) #Python_Tutorial #Python_Tutorial_for_Beginners #Python_for_Beginners #Python_course #python_tutorial #python_scripting_tutorial #Online_Course #Python_Guru #Learn_Python #Python_3 #Functions_in_Python #Python_Class #Python_Class_examples #python_3_class #Python_Exception_handling #Python_Try_Except #Exception_handling #Try_Except #Finally #expert #programmer #beginners #python