Courseiva

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

Exhibit

a = 10 // 3
b = 10 % 3
print(a, b)

Refer to the exhibit. What is the output?

⚠ Common exam trap

Python Institute often tests the difference between `/` (true division) and `//` (floor division) and `%` (modulo), and the trap here is that candidates confuse the modulo operator `%` with floor division `//`, expecting the integer 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

✓

3 1

The code in the exhibit is `print(10//3, 10%3)`. The `//` operator performs floor division, which for positive numbers truncates the decimal part, so `10//3` yields 3. The `%` operator returns the remainder of the division, `10%3` yields 1. Thus the output is '3 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.0 1.0

    Why it's wrong here

    10 / 3 produces 3.333..., not 3.0, so the first value is wrong; only 5 // 2 correctly floors to 2, not 1.0. The option tempts by pairing plausible-looking floats, but true division never truncates to a whole number here.

  • ✗

    3 3

    Why it's wrong here

    10 / 3 yields 3.333..., not 3, and 5 // 2 yields 2, not 3, so both values are wrong. The option tempts because integer-looking output appears when using // for both operands, but the first expression uses true division.

  • ✗

    3.333 1

    Why it's wrong here

    True division of 10 by 3 yields 3.333..., and 5 // 2 floors to 2, not 1, so this pairing misstates the floor-division result. The option tempts because it correctly shows true division's repeating decimal, which would appear if the second expression were 5 % 2 instead.

  • ✓

    3 1

    Why this is correct

    The exhibit's code produces two values on one line separated by a space, matching the stem's expected output. The first value derives from the initial computation and the second from the subsequent operation, giving the precise sequence 3 1 as shown.

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.