PCEP Practice Question: Data Types, Variables, Basic I/O and Operators
Which TWO of the following expressions will evaluate to True?
⚠ Common exam trap
Python Institute often tests the confusion between value equality (==) and identity equality (is), especially with integers and floats, where candidates mistakenly think '3 is 3' is False or that '3 != 3.0' is True due to type differences.
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
✓
3 == 3.0
In Python, the '==' operator compares values, and since integers and floats are compared by numeric value, 3 and 3.0 are numerically equal, so the expression evaluates to True. Option E is correct because 'is' checks object identity, and small integers like 3 are interned by Python, meaning they refer to the same object in memory, so '3 is 3' returns 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.
- ✗
3 is not 3
Why it's wrong here
False, 3 is 3.
- ✗
3 > 2 and 2 > 3
Why it's wrong here
False, second condition fails.
- ✗
3 != 3.0
Why it's wrong here
False, they are equal.
- ✓
3 == 3.0
Why this is correct
True, numeric comparison.
- ✓
3 is 3
Why this is correct
True, same integer object due to interning.
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.