ArithmeticError` এক্সসেপশন হলো ন্যুমেরিক ক্যালকুলেশনের জন্য~Occur হওয়া সকল এররর বেস ক্লাস। এটি সেস বিল্ট-ইন এক্সসেপশনগুলোর বেস ক্লাস: OverflowError, ZeroDivisionError, FloatingPointError`।
আমরা দেওয়া কোডে এক্সসেপশন ক্যাচ করতে পারি নিচেরভাবে:
উদাহরণ
import sys
try:
7/0
except ArithmeticError as e:
print(e)
print(sys.exc_type)
print('This is an example of catching ArithmeticError')
আউটপুট
integer division or modulo by zero <type 'exceptions.ZeroDivisionError'> This is an example of catching ArithmeticError