Courseiva

PCEP Practice Question: Data Types, Variables, Basic I/O and Operators

Which expression evaluates to False?

⚠ Common exam trap

Python Institute often tests whether candidates confuse the assignment operator `=` with the equality operator `==`, or mistakenly think that `<=` requires strict inequality, leading them to incorrectly evaluate `3 <= 3` as `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

✓

3 > 4

The expression `3 > 4` evaluates to `False` in Python, as 3 is not greater than 4. All other options evaluate to `True` due to the correct application of comparison operators: `<=`, `==`, and `!=`.

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 > 4

    Why this is correct

    The expression 3 > 4 evaluates to False because the greater-than operator compares the two integer operands and finds the left value smaller than the right. This directly satisfies the stem's requirement for an expression yielding False, unlike the other options whose comparisons return True.

  • ✗

    3 <= 3

    Why it's wrong here

    The less-than-or-equal operator includes equality, so 3 <= 3 evaluates to True. It is tempting to treat the bound as exclusive, as with <, but Python's <= returns True when operands match, so this is not the False expression.

  • ✗

    3 == 3

    Why it's wrong here

    The equality operator compares the two identical integer operands, so the expression yields True. It is tempting because equality tests can fail for objects lacking value comparison, but for plain integers 3 and 3 are equal, making this the wrong selection.

  • ✗

    3 != 2

    Why it's wrong here

    The inequality operator returns True because 3 and 2 are different values. It is tempting to read != as a negation that always yields False, but Python evaluates it as a genuine comparison, so this expression is True, not False.

About these practice questions

This PCEP question is part of Courseiva's 482-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 →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

4 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. Which of the following expressions evaluates to False?

easy
  • A.2 != 1
  • B.10 == 10
  • ✓ C.3 >= 4
  • D.5 < 10

Why C: (3 >= 4) evaluates to False because the 'greater than or equal to' operator (>=) returns True only if the left operand is greater than or equal to the right operand. Since 3 is neither greater than nor equal to 4, the expression is False.

Variation 2. Which TWO of the following expressions evaluate to True? (Choose two.)

easy
  • A.'a' > 'b'
  • B.5 > 10
  • ✓ C.3 == 3
  • D.bool(0)
  • ✓ E.not False

Why C: Option C (3 == 3) is correct because the equality operator compares the two integer literals 3 and 3, which are identical values, so the expression evaluates to True. Option E (not False) is correct because the logical not operator inverts the Boolean value False, yielding True. Option A ('a' > 'b') is incorrect because string comparison uses lexicographic ordering by character code point, and 'a' (97) is less than 'b' (98), so the expression is False. Option B (5 > 10) is incorrect because 5 is not greater than 10, so it evaluates to False. Option D (bool(0)) is incorrect because 0 is a falsy value in Python, so bool(0) returns False.

Variation 3. Which logical expression evaluates to True given that a = 5 and b = 10?

medium
  • A.a > b and b < 0
  • B.not (a < b)
  • ✓ C.not (a > b)
  • D.a == b or False

Why C: Given a = 5 and b = 10, the expression not (a > b) evaluates the inner comparison a > b, which is 5 > 10 = False, and then applies not, yielding True. This is the only option that evaluates to True with the given values. Understanding operator precedence and boolean negation is essential for PCEP-style questions.

Variation 4. Evaluate the expression: not (True or False) and (False or True). What is the result?

medium
  • A.SyntaxError
  • B.True
  • ✓ C.False
  • D.None

Why C: The expression is evaluated step by step: first, `True or False` evaluates to `True`; then `False or True` evaluates to `True`; the `not` operator negates the first `True` to `False`; finally, `False and True` evaluates to `False`. Therefore, the correct answer is C.

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.