PCEP Practice Question: Data Types, Variables, Basic I/O and Operators
Which THREE of the following expressions evaluate to True?
⚠ Common exam trap
Python Institute often tests the distinction between `/` (true division returning float) and `//` (floor division returning int), and the fact that modulo with even numbers always yields 0, tricking candidates who confuse remainder with quotient.
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
✓
10 / 2 == 5.0
The division operator `/` in Python always returns a float. Since 10 divided by 2 equals 5.0, and the comparison `==` checks value equality (not type), `5.0 == 5.0` evaluates to True.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
10 / 2 == 5.0
Why this is correct
True. Division yields 5.0.
- ✓
10 // 2 == 5
Why this is correct
True. Floor division yields 5.
- ✓
10 % 2 == 0
Why this is correct
True. Remainder is 0.
- ✗
10 // 2 == 5.1
Why it's wrong here
False. 5 != 5.1.
- ✗
10 % 2 == 1
Why it's wrong here
False. Remainder is 0.
Go deeper
Related to this question
About these practice questions
One of 498 original PCEP practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
3 more ways 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. Based on the exhibit, which expression returns 2.5 in Python?
easy- A.int(5 / 2)
- B.5 % 2
- C.5 // 2
- ✓ D.5 / 2
Why D: The division operator `/` in Python always returns a float, even when dividing two integers. Since 5 divided by 2 equals 2.5, the expression `5 / 2` returns the float `2.5`.
Variation 2. A developer writes a script to calculate the average of three numbers: avg = (a + b + c) / 3. If a=5, b=10, c=15, what is the data type of avg?
easy- ✓ A.float
- B.bool
- C.int
- D.str
Why A: In Python, the division operator (/) always returns a float, even when dividing integers that result in a whole number. Here, (5 + 10 + 15) / 3 equals 30 / 3, which yields 10.0, a float. Therefore, the data type of avg is float.
Variation 3. A developer writes: x = 5; y = 2.0; z = x / y; print(type(z)). What is the output?
easy- A.<class 'str'>
- B.<class 'int'>
- C.TypeError
- ✓ D.<class 'float'>
Why D: In Python, the division operator (/) always returns a float, even when dividing two integers. Here, x is an integer (5) and y is a float (2.0), so the result is a float (2.5). The type() function returns <class 'float'>, making D 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.