Courseiva

PCEP Computer Programming and Python Fundamentals Practice Question

A Python script contains the following code: x = 10 y = 3 result = x // y What is the value of result after execution?

⚠ Common exam trap

Test-takers frequently confuse floor division // with true division / or modulo %, especially when the result is a repeating decimal.

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

The // operator performs floor division, which divides the left operand by the right and rounds down to the nearest integer. With x=10 and y=3, 10 // 3 equals 3. The other options correspond to true division, rounding up, or modulo, none of which match the behavior of //.

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

    Why it's wrong here

    This is the result of true division using the / operator, which always returns a float. The // operator performs floor division, which discards the fractional part and returns an integer if both operands are integers. So this value would be correct for x / y, but not for x // y.

  • ✗

    1

    Why it's wrong here

    This is the remainder of 10 divided by 3, which would be the result of the modulo operator %. The // operator returns the quotient, not the remainder. So 1 is incorrect for this operation; it would be correct if the code used x % y.

  • ✗

    4

    Why it's wrong here

    This would be the result of rounding 3.333... up to the nearest integer, but floor division always rounds down (toward negative infinity). For positive numbers, it truncates the decimal part. The correct floor division of 10 by 3 is 3, not 4.

  • ✓

    3

    Why this is correct

    The // operator performs floor division, dividing x by y and rounding down to the nearest integer. 10 divided by 3 is 3.333..., and floor division yields 3. Since both operands are integers, the result is an int. This is the correct value for result.

About these practice questions

One of 482 original PCEP practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Python Institute exam blueprint

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.