PCEP Practice Question: Data Types, Variables, Basic I/O and Operators
Which data type is the result of: value = 10 // 3?
⚠ Common exam trap
Python Institute often tests the distinction between / (true division returning float) and // (floor division returning int), trapping candidates who assume all division in Python returns a float.
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
✓
int
The // operator in Python performs floor division, which divides the left operand by the right operand and returns the largest integer less than or equal to the result. Since both 10 and 3 are integers, the result is an integer (3), not a float. Therefore, the data type of value is int.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
float
Why it's wrong here
Floor division of two integers yields an int, so 10 // 3 returns 3, not a float. Float results arise from true division (10 / 3) or mixed-type operands, making this tempting whenever division is assumed to always produce decimals.
- ✗
str
Why it's wrong here
Floor division of two integers yields an int, so the result is 3, not a string; str would require explicit conversion such as str(10 // 3). It is tempting because output formatting often needs text, and str would be the correct type when concatenating the result into a message.
- ✓
int
Why this is correct
Floor division with `//` discards the fractional part and returns an integer when both operands are integers, so `10 // 3` yields `3`, not `3.333...`. This satisfies the stem's requirement for the exact data type of the result, which is `int`.
- ✗
bool
Why it's wrong here
Integer floor division with `//` yields an `int`, so `10 // 3` returns `3`, not a Boolean. `bool` is tempting because comparisons such as `10 > 3` produce `True` or `False`, and Boolean values are a subclass of `int` in Python, but arithmetic operators never return `bool`.
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.