Courseiva

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

Which THREE of the following statements about Python operators are true?

⚠ Common exam trap

Python Institute often tests the Python 3-specific change that the `/` operator always returns a float, trapping candidates who remember the Python 2 behavior where `/` performed integer division on integers.

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

✓

The not operator is a logical operator that negates a condition.

Option A is correct because 'not' is Python's logical negation operator, returning True for a falsy operand and False for a truthy one, so it negates a condition. Option B is correct because '//' performs floor division, dividing operands and rounding the result down to the nearest integer (e.g., 7 // 2 == 3, and -7 // 2 == -4). Option E is correct because '%' is the modulo operator, returning the remainder of integer or float division (e.g., 7 % 3 == 1). Option C is wrong because '**' is the exponentiation (power) operator, while bitwise XOR is '^'. Option D is wrong because '/' performs true division in Python 3 and always returns a float, even when both operands are integers (e.g., 4 / 2 == 2.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.

  • ✓

    The not operator is a logical operator that negates a condition.

    Why this is correct

    The `not` operator is a logical (Boolean) operator that inverts the truth value of its operand, returning `True` for a falsy operand and `False` for a truthy one. This directly satisfies the stem's requirement for a true statement about Python operators, as `not` is one of the three logical operators alongside `and` and `or`.

  • ✓

    The // operator performs floor division.

    Why this is correct

    The `//` operator performs floor division, dividing operands and rounding the result down towards negative infinity. This satisfies the stem's requirement for a true statement about Python operators. Unlike `/`, which always returns a float, `//` returns an integer when both operands are integers, making it the correct choice here.

  • ✗

    The ** operator is the bitwise XOR operator.

    Why it's wrong here

    In Python, ** performs exponentiation; bitwise XOR is the ^ operator. It is tempting because ** resembles the caret notation used for XOR in some other languages and mathematics, so candidates assume the symbols map across, but Python reserves ** for raising to a power.

  • ✗

    The / operator always returns an integer if both operands are integers.

    Why it's wrong here

    In Python 3, / performs true division and returns a float even when both operands are integers; floor division uses //. It is tempting because in Python 2 and many statically typed languages integer division truncates, so candidates carry that behaviour across to Python 3.

  • ✓

    The % operator returns the remainder of division.

    Why this is correct

    The modulo operator % performs integer remainder division, returning what is left after dividing the left operand by the right. For example, 7 % 3 yields 1. This satisfies the question's requirement for a true statement about Python operators, distinguishing it from floor division //, which discards the remainder.

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 →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way 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 THREE of the following are Python built-in data types?

medium
  • A.array
  • ✓ B.bool
  • C.char
  • ✓ D.float
  • ✓ E.int

Why B: Option B (bool) is a Python built-in type used for the two truth values True and False, and it is a subclass of int. Option D (float) is a built-in numeric type representing double-precision floating-point numbers such as 3.14. Option E (int) is a built-in numeric type for arbitrary-precision integers, so it is correct as well. Option A (array) is not a built-in type; it is provided by the standard-library array module (or similar third-party libraries), so it must be imported rather than being built in. Option C (char) is not a Python built-in type at all; Python represents single characters as strings of length 1, and there is no char type.

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.