Courseiva

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

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

⚠ Common exam trap

Python Institute often tests the distinction between the / operator (always returns float) and the // operator (returns int when both operands are ints), and the misconception that % returns the quotient instead of the remainder.

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 ** operator performs exponentiation.

Option A is correct because in Python the ** operator is the exponentiation operator, so 2 ** 3 evaluates to 8. Option B is correct because // performs floor division, discarding the fractional part, and returns an int when both operands are ints (e.g., 7 // 2 gives 3). Option C is correct because the / operator performs true division and always returns a float, even for evenly divisible integers (e.g., 4 / 2 gives 2.0). Option D is not correct because + cannot concatenate a string and an integer directly; doing so raises a TypeError unless the integer is converted with str(). Option E is not correct because % is the modulo operator and returns the remainder of a division, not the quotient.

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 ** operator performs exponentiation.

    Why this is correct

    Python's arithmetic operator set includes ** for exponentiation, so 2 ** 3 evaluates to 8. This satisfies the stem's requirement for a correct operator statement, distinguishing it from operators such as ^, which performs bitwise XOR rather than raising to a power.

  • ✓

    The // operator performs floor division and returns an int if both operands are ints.

    Why this is correct

    The // operator performs floor division, discarding the fractional part and rounding toward negative infinity. When both operands are ints, the result is an int, satisfying the stem's requirement for a correct statement about Python operators.

  • ✓

    The / operator always returns a float.

    Why this is correct

    True division via / always produces a float, even when both operands are ints and divide evenly, so 4 / 2 yields 2.0. This satisfies the stem's requirement for a correct operator statement, unlike // which returns an int for int operands.

  • ✗

    The + operator can be used to concatenate strings and integers.

    Why it's wrong here

    Python's + operator concatenates two strings or adds two numbers; mixing a string with an integer raises a TypeError, so this statement is false. It is tempting because + genuinely performs string concatenation when both operands are strings, which is the correct choice for joining text values.

  • ✗

    The % operator returns the quotient.

    Why it's wrong here

    The % operator returns the remainder of integer division, not the quotient; // performs floor division and yields the quotient. It is tempting because % is grouped with arithmetic operators, but confusing it with division ignores its actual modulo semantics, which the exam expects candidates to state precisely.

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

2 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. What does 'print(2 ** 3)' output?

easy
  • A.9
  • B.23
  • ✓ C.8
  • D.6

Why C: The ** operator in Python performs exponentiation, raising the left operand (2) to the power of the right operand (3), which equals 8. The print() function then outputs this integer result to the console.

Variation 2. Which data type is the result of: value = 10 // 3?

easy
  • A.float
  • B.str
  • ✓ C.int
  • D.bool

Why C: The // operator in Python performs floor division, which divides the left operand by the right operand and returns the largest integer less than or equal to the result. Since both 10 and 3 are integers, the result is an integer (3), not a float. Therefore, the data type of value is int.

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.