Courseiva

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

A developer runs this code:

a = 10 b = 3 a += b * 2 a //= b

print(a)

What is printed?

⚠ Common exam trap

The trap here is reading a //= b as true division and expecting a fractional result, when //= always floors 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

✓

5

Augmented assignment evaluates the right-hand side first, so b * 2 is 6 and a becomes 16. The floor division assignment a //= b then divides 16 by 3 and rounds down to 5. Because both operands are ints, the result stays an int and print displays 5 without a decimal point.

Answer analysis

Option-by-option breakdown

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

  • ✗

    5.333333333333333

    Why it's wrong here

    This would be the result of true division using /= instead of //=. The code uses a //= b, which performs floor division and discards the fractional part. The value 16 / 3 is approximately 5.33, but flooring yields 5. Choosing this indicates confusion between /= and //= augmented operators.

  • ✗

    3

    Why it's wrong here

    A result of 3 would occur if a were divided before adding b * 2, such as (10 // 3) + 6, which is 3 + 6 = 9, still not 3. Alternatively, it could come from mistakenly applying //= to b instead of a. The statement a //= b modifies a, not b, and the addition happens first, so the value cannot be 3.

  • ✗

    6

    Why it's wrong here

    6 would result if 16 // 3 were rounded up or if b * 2 were added after the floor division, such as (10 // 3) + 6 = 9, which is still not 6. The correct sequence gives 16 then 5. This distractor reflects either rounding up or reordering the augmented assignments.

  • ✓

    5

    Why this is correct

    The expression b * 2 is 6, so a += 6 makes a equal 16. Then a //= b performs floor division by 3, and 16 // 3 is 5 because 5 * 3 is 15 with 1 left over. The result is an int, so print outputs 5. This follows augmented assignment and operator precedence correctly.

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