QuestionQ250

VerifiedComputer Programming and Python Fundamentals

Which of these expressions evaluates to zero?

Choose two
Explanation

In 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 more

Community Discussion

No comments yet. Be the first to start the discussion!