@kjm said in Exceptions in micro python: ZeroDivisionError: division by zero The super class of ZeroDivisionError is ArithmeticError. This exception raised when the second argument of a division or modulo operation is zero. In Mathematics, when a number is divided by a zero, the result is an infinite number. It is impossible to write an Infinite number physically. Python interpreter throws “ZeroDivisionError: division by zero” error if the result is infinite number. While implementing any program logic and there is division operation make sure always handle ArithmeticError or ZeroDivisionError so that program will not terminate. try: z = x / y except ZeroDivisionError: z = 0 Or check before you do the division: if y == 0: z = 0 else: z = x / y The latter can be reduced to: z = 0 if y == 0 else (x / y)