PCEP Practice Question: Data Types, Variables, Basic I/O and Operators
Which TWO of the following expressions evaluate to 0? (Select two.)
⚠ Common exam trap
Python Institute often tests the distinction between boolean values in arithmetic versus comparison contexts, tricking candidates into thinking `True == 0` evaluates to the integer 0 rather than the boolean `False`.
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
✓
False * 1
In Python, `False` is treated as 0 in arithmetic contexts, so `False * 1` evaluates to `0 * 1 = 0`. Option D is correct because `int(0.5)` truncates the decimal part toward zero, resulting in the integer 0.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
False * 1
Why this is correct
False is 0, product is 0.
- ✗
5 // 2 * 2
Why it's wrong here
Equals 4.
- ✗
True == 0
Why it's wrong here
Returns False, not 0.
- ✓
int(0.5)
Why this is correct
Truncates to 0.
- ✗
5 % 2
Why it's wrong here
Equals 1.
Go deeper
Related to this question
About these practice questions
This PCEP question is part of Courseiva's 498-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.