QuestionQ41Verified/ExceptionsCopy linkReport a problemAsk AstroTutorSave questionWhich of these code snippets runs without causing any unhandled exceptions?Choose twoABCDShow AnswerAnswerExplanationA try statement’s else clause runs when the try suite completes without an exception, so A prints the two valid division results. In B, assigning and subsequently incrementing x are valid operations. C attempts to use the undefined name y again inside its exception handler, and D raises ZeroDivisionError, not NameError.Show comments1Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion