⊗pyPmExcBT 75 of 128 menu

Basic Exception Types in Python

Let's look at some of the main types of exceptions that occur in Python.

An exception of type TypeError is an error that occurs when a variable or parameter has an invalid type. For example, such an exception would occur if you added a string and a number.

An exception of type SyntaxError is an error that occurs when code is not written correctly. This exception also includes IndentationError (incorrect indentation) and TabError (mixed tabs and spaces in indentation).

An exception of type ArithmeticError occurs when there is an arithmetic error in the code. This exception also includes ZeroDivisionError, which occurs when dividing by zero.

There are other types of exceptions. You can read their full description here.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline