PCEP Practice Question: Data Types, Variables, Basic I/O and Operators
Which TWO of the following expressions evaluate to True in Python? (Choose two.)
⚠ Common exam trap
Python Institute often tests the misconception that `True` and `False` are completely separate from integers, leading candidates to incorrectly reject options A and B, or to mistakenly believe that `'0'` or `None` are falsy enough to equal `0` or `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
✓
1 == True
Option A (1 == True) is correct because Python's bool is a subclass of int, so True has the integer value 1 and the equality comparison returns True. Option B (0 == False) is correct for the same reason: False has the integer value 0, so comparing it to 0 yields True. Option C ('0' == 0) is not correct because a str and an int are different types and are never equal in Python. Option D (2 == True) is not correct because True equals 1, not 2. Option E (None == False) is not correct because None is a distinct object that is only equal to None, not to False.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
1 == True
Why this is correct
Python's bool type subclasses int, so True equals the integer 1 in comparisons. The equality operator checks numeric value rather than identity, making 1 == True evaluate to True. This satisfies the stem's requirement for expressions returning True.
- ✓
0 == False
Why this is correct
False is a subclass of int with numeric value 0, so 0 == False compares equal values and returns True. This numeric equivalence, not identity, drives the result, satisfying the stem's requirement for expressions evaluating to True.
- ✗
'0' == 0
Why it's wrong here
Comparing a string with an integer returns False in Python 3; no implicit type coercion occurs, so '0' == 0 is False. It tempts because both look like zero, but '0' == '0' or 0 == 0 would each evaluate to True.
- ✗
2 == True
Why it's wrong here
Python compares int and bool numerically, so True equals 1, making 2 == True False. It tempts because True is often treated as truthy in conditions, yet equality here is value-based; 1 == True would evaluate to True.
- ✗
None == False
Why it's wrong here
None equals False is False, since None is the sole NoneType object and False is a bool; equality compares type and value, so they differ. It tempts because both are falsy in boolean contexts, yet falsiness does not imply equality.
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.