What does the operator // denote?

Study for the End of Year 8 Computer Science Test. Prepare with flashcards and multiple choice questions, each with hints and explanations. Get ready for your exam!

Multiple Choice

What does the operator // denote?

Explanation:
Integer division returns the whole-number quotient when dividing two numbers. The // operator performs that: it divides and drops any remainder, giving an integer result. For example, 7 // 3 = 2 because 3 goes into 7 twice with a remainder of 1. This is different from ordinary division (which would give 2.333…) and from the remainder operation (which would give 1). Note that with negative numbers, floor division rounds down, so -7 // 3 equals -3, not -2.

Integer division returns the whole-number quotient when dividing two numbers. The // operator performs that: it divides and drops any remainder, giving an integer result. For example, 7 // 3 = 2 because 3 goes into 7 twice with a remainder of 1. This is different from ordinary division (which would give 2.333…) and from the remainder operation (which would give 1). Note that with negative numbers, floor division rounds down, so -7 // 3 equals -3, not -2.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy