QuestionQ70Verified/Functions, Classes and ObjectsCopy linkReport a problemAsk AstroTutorSave questionWhat will the following Python 3 code produce? Aouter x, outer xBinner x, inner xCglobal x, outer xDNameError, outer xEinner x, outer xShow AnswerAnswerExplanationPython uses lexical scope resolution. Since inner_func has no local variable named x, it reads the x defined in the enclosing outer_func; the later print in outer_func reads that same value.Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion