Exception handling in python in Hindi | Python Tutorial in Hindi смотреть онлайн
Exception handling in python | Python Tutorial in Hindi
This video is about exception handling in python in hindi, In python, all exceptions must be instances of a class that derives from base exception . In a try statement of python with an except clause that mentions a particular class, that clause also handles any exception classes derived from that class (but not exception classes from which it is derived). Two exception classes that are not related via subclassing are never equivalent, even if they have the same name.
Error in Python can be of two types i.e. Syntax errors and Exceptions. Errors in the python are the problems in a program due to which the program will stop the execution. On the other hand, exceptions in python are raised when some internal events occur which changes the normal flow of the program.
Even if a statement or expression is syntactically correct, it may cause an error when an attempt is made to execute it. Errors detected during execution are called exceptions in python . Most exceptions in python are not handled by programs, however, and result in error messages
The built-in exceptions in python can be generated by the interpreter or built-in functions. Except where mentioned, they have an “associated value” indicating the detailed cause of the error. This may be a string or a tuple of several items of information (e.g., an error code and a string explaining the code). The associated value is usually passed as arguments to the exception class’s constructor.
User code can raise built-in exceptions. This can be used to test an exception handler or to report an error condition “just like” the situation in which the interpreter raises the same exception; but beware that there is nothing to prevent user code from raising an inappropriate error.
When raising an exception in an except or finally clause __context__ is automatically set to the last exception caught; if the new exception is not handled the traceback that is eventually displayed will include the originating exception(s) and the final exception.
The cause of an exception is often external to the program itself. For example, an incorrect input, a malfunctioning IO device etc. Because the program abruptly terminates on encountering an exception, it may cause damage to system resources, such as files. Hence, the exceptions should be properly handled so that an abrupt termination of the program is prevented.
Python uses try and except keywords to handle exceptions. Both keywords are followed by indented blocks.
A try and except block in python is used for error handling in Python.
• Try block in python : Helps to test the code. If the code inside the try block is error free it is executed. Otherwise the error gets caught and control goes to the except block.
• Except in python : Except displays the error message.
• Else: Executes if there is no error in the code in the try block.
• Finally: Executes independently of the try-except block results.
The Else and Finally block are optional but it is considered a good programming practice to include them.
Music http://www.bensound.com
Like us on fb http://www.facebook.com/learningseveryday
Our Blog http://www.ethtimes1.blogspot.com
http://www.pythonqns.blogspot.com
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Exception handling in python in Hindi | Python Tutorial in Hindi» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.