Python True Division (/) Operator
Exhibit
Refer to the exhibit. >>> x = 4.5 >>> y = 2 >>> print(x // y)
What is the output?
Quick Answer
The correct output is 2.25. This result comes from Python’s true division operator (/), which always returns a float, even when dividing two integers. In the expression 9 / 4, Python 3 performs floating-point division, yielding 2.25 rather than truncating to 2. On the Certified Entry-Level Python Programmer PCEP exam, this question tests your understanding of the fundamental difference between true division (/) and floor division (//). A common trap is assuming integer division produces an integer result, as it does in Python 2 or with the // operator. Remember: the single slash always gives a float, so 9 / 4 is never 2—it is always 2.25. For a quick memory tip, think “True division = Float forever.”
⚠ Common exam trap
Candidates often mistakenly think that `/` performs floor division or that the result is truncated to an integer. However, in Python 3, `/` always returns a float, and `9/4` yields 2.25, not 2.0 or 2.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
2.25
In Python 3, the `/` operator performs true division, which always returns a float. The expression `9 / 4` divides 9 by 4, resulting in 2.25. Option A correctly states this result.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
2.25
Why this is correct
Correct because `9/4` in Python 3 returns 2.25 as a float.
- ✗
Error
Why it's wrong here
Incorrect; Python 3 `/` does not raise an error, it returns a float.
- ✗
2.0
Why it's wrong here
Incorrect; `9/4` equals 2.25, not 2.0.
- ✗
2
Why it's wrong here
Incorrect; `9/4` is not 2; it returns a float, not an integer.
Go deeper
Related to this question
About these practice questions
Courseiva writes every PCEP question from scratch — 498 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on PCEP
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A programmer writes: x = 5; y = 2; result = x / y. What is the type of result?
medium- A.int
- ✓ B.float
- C.str
- D.complex
Why B: In Python 3, the division operator (/) always returns a floating-point number, even if both operands are integers. Since x and y are both integers (5 and 2), the result of 5 / 2 is 2.5, which is of type float. Therefore, option B is correct.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PCEP practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCEP exam.