QuestionQ279

VerifiedComputer Programming and Python Fundamentals

What output is expected from the following code?

print(1 // 2 * 3)  
Explanation

Python evaluates floor division and multiplication from left to right at the same precedence level. 1 // 2 evaluates to 0, and multiplying that result by 3 produces 0.

Community Discussion

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