SarkariResultess QA Bank

ZeroDivisionError को कैसे रोकें? Google पर developer को मिलने वाला सबसे उपयोगी समाधान क्या है?

Other 0 Views Verified
ZeroDivisionError को कैसे रोकें? Google पर developer को मिलने वाला सबसे उपयोगी समाधान क्या है?
Sarkari Result QA Bank
Editorially reviewed exam information

Answer & Explanation

4 Answers
Verified

divisor = None

divisor = None
Additional Explanation
यह विकल्प सही समाधान नहीं है।
Verified Correct Answer

if divisor != 0: result = number / divisor

if divisor != 0: result = number / divisor
Additional Explanation
Division से पहले zero check या exception handling करें।
Verified

result = number / 0

result = number / 0
Additional Explanation
यह विकल्प सही समाधान नहीं है।
Verified

try: number / 0 without handling

try: number / 0 without handling
Additional Explanation
यह विकल्प सही समाधान नहीं है।