Courseiva

PCEP Computer Programming and Python Fundamentals Practice Question

A beginner writes: x = 10; y = 3; print(x // y). What is the output?

⚠ Common exam trap

The PCEP exam often tests the distinction between floor division (//) and true division (/) by using integer operands, leading candidates to mistakenly expect a float result or to confuse floor division with truncation toward zero.

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 in Python performs floor division, which returns the largest integer less than or equal to the result of the division. Since 10 divided by 3 equals 3.333..., the floor of that value is 3, and because both operands are integers, the result is an integer (3), not a float.

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

    Why this is correct

    The // operator performs floor division, discarding the fractional part and rounding toward negative infinity. With 10 divided by 3, the true quotient is 3.333..., so floor division returns the integer 3, not 3.33 or 4.

  • ✗

    1

    Why it's wrong here

    The remainder operator % returns 1 for 10 % 3, not the quotient. Floor division // returns how many whole times 3 fits into 10, which is 3. The value 1 tempts candidates who mix up the two operators, but the question uses //, so the quotient is required.

  • ✗

    3.0

    Why it's wrong here

    Floor division of two integers returns an int, so 10 // 3 yields 3, not 3.0. The float result appears only when an operand is a float, as in 10.0 // 3. A beginner may expect true division's decimal form, but // truncates toward negative infinity and preserves the integer type here.

  • ✗

    3.333

    Why it's wrong here

    The // operator performs floor division, discarding the fractional part, so 10 // 3 gives 3, not 3.333. That decimal value is what true division (/) produces. The option tempts candidates who confuse the two operators, but the double slash never returns a repeating fraction.

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