Home / Questions / Other ZeroDivisionError को कैसे रोकें? कौन सा code pattern सही समाधान है? — error आने पर developer क्या करे? Other 0 Views Verified ZeroDivisionError को कैसे रोकें? कौन सा code pattern सही समाधान है? — error आने पर developer क्या करे? #python #error #debugging #exception #solution Sarkari Result QA Bank Editorially reviewed exam information Share
Verified Correct Answer if divisor != 0: result = number / divisor if divisor != 0: result = number / divisor Additional Explanation Division से पहले zero check या exception handling करें। पहले traceback की exact line और input value check करें।
Verified result = number / 0 result = number / 0 Additional Explanation यह विकल्प सही समाधान नहीं है।
Verified try: number / 0 without handling try: number / 0 without handling Additional Explanation यह विकल्प सही समाधान नहीं है।