PCEP Practice Question: Data Types, Variables, Basic I/O and Operators
Which operator is used for integer division in Python?
⚠ Common exam trap
Python Institute often tests the distinction between / (true division returning a float) and // (floor division returning an integer), trapping candidates who assume / always performs integer division in Python as it does in some other languages.
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
✓
//
The // operator in Python performs floor division, which returns the integer quotient after dividing two numbers, discarding any fractional remainder. For example, 7 // 2 yields 3, not 3.5, making it the explicit integer division operator.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
%
Why it's wrong here
The % operator returns the remainder of division, not the integer quotient. It is tempting because it is a division-related arithmetic operator, and it would be correct when the task requires the modulo remainder rather than the floored quotient.
- ✗
**
Why it's wrong here
The ** operator performs exponentiation, raising a number to a power, so it cannot return the floored quotient. It is tempting because it is an arithmetic operator, and it would be the correct choice when the requirement is to compute powers rather than divide.
- ✗
/
Why it's wrong here
The / operator performs true division and always returns a float, so it does not produce an integer result. It is tempting because it is the standard division symbol, and it would be correct when a floating-point quotient is required.
- ✓
//
Why this is correct
The `//` operator performs floor division, returning the largest integer less than or equal to the true quotient. For positive integers this discards the fractional part, satisfying the stem's requirement for integer division. Unlike `/`, which always yields a float in Python 3, `//` preserves integer type when both operands are integers.
Go deeper
Related to this question
About these practice questions
Courseiva writes every PCEP question from scratch — 482 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 →
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.