PCEP Computer Programming and Python Fundamentals Practice Question
What is the output of the following code?
print('Hello'.upper())⚠ Common exam trap
The PCEP exam often tests whether candidates understand that `.upper()` does not add or remove characters—it only changes the case of alphabetic characters, so any extra punctuation or unchanged casing indicates a misunderstanding of the method's exact behavior.
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
✓
HELLO
The `.upper()` string method in Python returns a new string with all lowercase letters converted to uppercase. The string `'Hello'` contains the characters 'H', 'e', 'l', 'l', 'o'; after applying `.upper()`, it becomes `'HELLO'`. The output is exactly `HELLO` without any additional characters.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
hello
Why it's wrong here
That's lowercased.
- ✗
HELLO!
Why it's wrong here
Exclamation not added.
- ✓
HELLO
Why this is correct
Converts to uppercase.
- ✗
Hello
Why it's wrong here
Original case is returned.
Go deeper
Related to this question
About these practice questions
One of 498 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.