Courseiva

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

What is the result of 17 % 5 in Python?

⚠ Common exam trap

Python Institute often tests the distinction between the modulo operator (%) and floor division (//), trapping candidates who confuse the remainder with the quotient.

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

✓

2

In Python, the % operator performs modulo division, returning the remainder after integer division. 17 divided by 5 equals 3 with a remainder of 2 (since 5 * 3 = 15, and 17 - 15 = 2), so 17 % 5 evaluates to 2.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    2

    Why this is correct

    The modulo operator returns the remainder after integer division, so 17 % 5 evaluates to 2 because 5 divides into 17 three times (15) with 2 left over. This satisfies the stem's requirement for the exact result of the expression, matching Python's behaviour for positive integers.

  • ✗

    4

    Why it's wrong here

    17 % 5 returns the remainder after dividing 17 by five, which is 2, not 4. The value 4 is tempting because it is the quotient of 17 divided by 5 rounded down, confusing modulo with integer floor division; modulo yields what is left over, so 5 × 3 = 15 leaves 2.

  • ✗

    3

    Why it's wrong here

    17 % 5 returns 2, the leftover after subtracting 15; 3 is the quotient, not the remainder. It is tempting because 3 is the integer result of 17 // 5, so confusing the modulo operator with floor division produces this value; the two operators differ in exactly what they return.

  • ✗

    1

    Why it's wrong here

    17 % 5 evaluates to 2, since 5 × 3 = 15 and 17 − 15 = 2; 1 is not the remainder. It is tempting because 1 is the remainder of 16 % 5, and off-by-one slips are common when mentally subtracting the nearest multiple below the dividend.

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.