PCEP Computer Programming and Python Fundamentals Practice Question
A Python script calculates the area of a circle: radius = 5; area = 3.14 * radius ** 2; print(area). What is printed?
⚠ Common exam trap
The Python Institute often tests operator precedence by embedding exponentiation in a multiplication expression, trapping candidates who mistakenly compute `(3.14 * radius) ** 2` (yielding 246.49) or who confuse area with circumference (2 * pi * r).
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
✓
78.5
78.5 because the expression `3.14 * radius ** 2` is evaluated according to Python's operator precedence: exponentiation (`**`) has higher precedence than multiplication (`*`), so `radius ** 2` computes 5 squared (25), then multiplied by 3.14 gives 78.5. The `print(area)` function outputs this value.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
78.5
Why this is correct
The exponentiation operator ** binds tighter than multiplication, so radius ** 2 evaluates first, giving 25. Multiplying by 3.14 yields 78.5, which print outputs. This satisfies the stem's requirement to determine the exact value produced by the given expression.
- ✗
157.0
Why it's wrong here
Exponentiation binds tighter than multiplication, so radius ** 2 evaluates to 25, then 3.14 * 25 gives 78.5, not 157.0. The distractor tempts candidates who mentally double the result or misread 3.14 as 6.28, effectively computing 2 * pi * r squared instead of pi * r squared.
- ✗
25.0
Why it's wrong here
Exponentiation is evaluated before multiplication, so 3.14 * radius ** 2 computes 3.14 * 25, giving 78.5; 25.0 is only the intermediate value of radius ** 2 before the multiplication by 3.14 is applied. It is tempting because it is the squared radius.
- ✗
31.4
Why it's wrong here
Python's ** operator binds tighter than *, so radius ** 2 evaluates to 25, then 3.14 * 25 yields 78.5, not 31.4. It is tempting as the result of 3.14 * 10, which would arise only if radius were squared incorrectly or multiplied by 2 instead.
Quick reference
AAA Protocol Comparison
| Protocol | Port(s) | Encryption | Transport | Primary Use |
|---|---|---|---|---|
| RADIUS | 1812 / 1813 | Password only | UDP | Network access control |
| TACACS+ | 49 | Full packet | TCP | Device administration |
| Diameter | 3868 | Full session | TCP / SCTP | Carrier / mobile networks |
| 802.1X | — | EAP-based | Layer 2 | Port-based access control |
TACACS+ encrypts the entire packet; RADIUS only encrypts the password field — a key exam distinction.
Go deeper
Related to this question
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 →
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.