print("the method of class "class ( )def disp(self)print("the method of class "#create object #ob= (we cannot create object #ob disp(#we cannot call the method ob = (ob disp(ob = (ob disp(error and exceptionsdifference between an error and exception there are (at leasttwo distinguishable kinds of errorssyntax errors and exceptions syntax errorthese errors are occur when we violate the rules of python and these are most common kind of errors that we get while we learn any new programming language examples( if >= syntaxerrorinvalid syntax here at the end ofif statement (:colon should be writtenerror will be generated otherwise violating indentationmissing (:colon at the end of loop statements etc exception erroreven if statement is syntactically correctit may still cause an error when executed such errors that occur at run-time are known as "exceptionsthe logical error may occur due to wrong algorithm or logic while solving particular problem these logical errors may lead to exceptions examples of exceptions are as followy+ nameerrorname 'yis not defined +'xtypeerrorunsupported operand type(sfor +'intand 'str *( / zerodivisionerrordivision by zero =[ , , [ indexerrorlist index out of range ={ :' ', :' ', :' ' [ keyerror problem with exceptionthe normal execution of the program will be abruptly terminated because of the exception in generaljust because of single run-time errorit is not reasonable to terminate the program abruptlyeven if program contains some legal lines to solve this problem the exceptions must be handled in python these exceptions are handled using the try and except blocks handling exceptions page