QuestionQ1Verified/Object-Oriented ProgrammingCopy linkReport a problemAsk AstroTutorSave questionWhat is the expected outcome of the following code? Ait outputs 6Bit raises an exceptionCit outputs 1Dit outputs 3Show AnswerAnswerExplanationDouble-underscore identifiers declared or referenced within a class are name-mangled. Both foo() calls update the shared _Class__Var, leaving it at 2; the first instance’s _Class__prop remains 1. Their sum is therefore 3.Learn morePython documentation: Classes—Private VariablesShow comments1Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion