Question:

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 11, 2026
  • 2.5
  • 2
  • 3
  • Error
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation


Step 1: Understanding the Concept:

Python provides different types of division operators: for standard division and // for "Floor Division."

Step 2: Detailed Explanation:

1. Standard division ($5 / 2$) would result in $2.5$. 2. Floor division ($5 // 2$) performs the division and then "rounds down" to the nearest whole integer. 3. Mathematically: $5 \div 2 = 2.5$. The "floor" of $2.5$ is $2$. Note: If the result is negative, it still rounds down (away from zero). For example, $-5 // 2$ would be $-3$.

Step 3: Final Answer:

The output of 5 // 2 is 2.
Was this answer helpful?
0
0