QuestionQ250Verified/Computer Programming and Python FundamentalsCopy linkReport a problemAsk AstroTutorSave questionWhich of these expressions evaluates to zero?Choose twoA2 // 4 * 1 / 3B4 / 1 * 2 - 1Cl * 2 / 4 * 3D-1 / 3 * 3 + 1Show AnswerAnswerExplanationIn Python, // performs floor division, and *, /, and // share a precedence level and associate from left to right. Thus, 2 // 4 produces 0, making the entire first expression zero. In the fourth expression, division and multiplication produce -1.0, and adding 1 yields 0.0.Learn morePython Language Reference — ExpressionsShow comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion