PCEP Exponentiation operator Practice Question
Exhibit
Refer to the exhibit.
def func(a, b=2, c=3):
return a + b + c
print(func(1, c=5))What is the output?
⚠ Common exam trap
A common trap is confusing the exponentiation operator `**` with multiplication. Candidates might incorrectly think `2 ** 3` means 2 × 3 = 6, but `**` means exponentiation, not multiplication.
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
✓
8
The code `print(2 ** 3)` computes 2 raised to the power of 3, which equals 8. Exponentiation is performed right-to-left and has higher precedence than multiplication, but in this simple case, it directly yields 8. Therefore, option D is correct.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Error
Why it's wrong here
There is no syntax error in `print(2 ** 3)`, so 'Error' is incorrect.
- ✗
9
Why it's wrong here
9 would be the result of `3 ** 2` (3 squared), not `2 ** 3`.
- ✗
6
Why it's wrong here
6 would be the result of `2 * 3` (multiplication), not exponentiation.
- ✓
8
Why this is correct
Correct. `2 ** 3` evaluates to 8.
Go deeper
Related to this question
About these practice questions
Courseiva writes every PCEP question from scratch — 498 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 →
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.