Courseiva

PCEP Computer Programming and Python Fundamentals Practice Question

A student runs the following code in a Python 3.11 interactive session:

>>> 7 // 2

What is displayed?

⚠ Common exam trap

Many candidates confuse floor division with true division or with the modulo operator, since all three use similar symbols but produce different values.

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

Floor division with the double forward slash operator divides two numbers and rounds the result down to the nearest whole number. With integer operands, Python returns an integer. Because seven divided by two is three with a remainder of one, the floor value is three, and that integer is what the interactive session displays.

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

    Why it's wrong here

    The single forward slash operator performs true division and would return 3.5, but the code uses the double forward slash operator, which is floor division. Floor division discards the fractional part and returns an integer when both operands are integers, so 3.5 is not the result displayed here.

  • ✗

    1

    Why it's wrong here

    The value 1 is the remainder of the division 7 divided by 2, which is what the modulo operator percent would produce. The code uses the double forward slash operator instead, which returns the quotient rounded down. Therefore 1 is not the output of 7 // 2.

  • ✓

    3

    Why this is correct

    The double forward slash operator performs floor division, dividing the left operand by the right operand and rounding the result down to the nearest whole number. Since both 7 and 2 are integers, Python returns an integer, and 7 divided by 2 is 3 with a remainder, so the floor is 3.

  • ✗

    4

    Why it's wrong here

    Rounding 3.5 up to 4 would be the result of a ceiling operation, not floor division. Python's floor division always rounds toward negative infinity, so the fractional part is discarded rather than rounded to the nearest integer. The expression 7 // 2 yields 3, not 4.

About these practice questions

This PCEP question is part of Courseiva's 482-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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.