Courseiva

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

A junior developer writes: x = 10; y = 3; print(x % y). What will be printed?

⚠ Common exam trap

Python Institute often tests the distinction between the modulo operator (%) and integer division (//) or floating-point division (/), trapping candidates who confuse remainder with quotient or decimal result.

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

The modulo operator (%) returns the remainder of the division of the left operand by the right operand. Here, 10 divided by 3 equals 3 with a remainder of 1, so print(x % y) outputs 1.

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.33

    Why it's wrong here

    The % operator returns the integer remainder, not decimal division; 10 % 3 yields 1. It is tempting because 10/3 approximates 3.33, but true division uses the / operator, whereas % computes what is left after subtracting the largest whole multiple.

  • ✓

    1

    Why this is correct

    The modulo operator returns the remainder after integer division, so 10 % 3 evaluates to 1 because 3 divides into 10 three times with 1 left over. This satisfies the stem's requirement to predict the printed output of the expression.

  • ✗

    0

    Why it's wrong here

    10 % 3 leaves remainder 1, not 0; 0 would require the divisor to divide the dividend exactly, as in 9 % 3. It is tempting because modulo is often associated with even divisibility checks, but here 3 does not divide 10 without remainder.

  • ✗

    3

    Why it's wrong here

    The % operator returns the remainder, not the quotient; 10 // 3 gives 3, while 10 % 3 gives 1. It is tempting because 3 is the whole-number result of dividing 10 by 3, but that is floor division, a different operator.

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

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.