QuestionQ25Verified/Functions and ExceptionsCopy linkReport a problemAsk AstroTutorSave questionWhat is the anticipated output from the following code? A4 1B4 4C1 4DThe code is erroneous.E1 1Show AnswerAnswerExplanationAn assignment to num inside a function makes it local to that function unless it is declared global or nonlocal. Evaluating num = num + 3 therefore reads the local variable before it has been assigned, which raises an UnboundLocalError.Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion