Question:medium

What will be the output?
x = 5
y = 2
print(x // y)

Show Hint

To remember the difference: - ‘/‘ gives you the decimal. - ‘//‘ gives you the integer (quotient). - ‘%‘ gives you the remainder.
Updated On: May 30, 2026
  • 2.5
  • 2
  • 3
  • Error
Show Solution

The Correct Option is B

Solution and Explanation

Step 1: Understanding the Concept:
The // operator in Python is the floor division operator.
Step 2: Detailed Explanation:
- The standard division operator \( / \) returns a float. For example, \( 5 / 2 = 2.5 \).
- The floor division operator \( // \) divides the numbers and then applies the "floor" function to the result (rounding down to the nearest integer).
Calculation:
\[ 5 \div 2 = 2.5 \]
Applying floor:
\[ \lfloor 2.5 \rfloor = 2 \]
Step 3: Final Answer:
The result of the print statement is 2.
Was this answer helpful?
0


Questions Asked in CUET (UG) exam