PCEP Practice Question: Data Types, Variables, Basic I/O and Operators
Given the code: ```python name = input('Enter your name: ')
print('Hello, ' + name)``` If the user enters 'Alice', what is the output?
⚠ Common exam trap
Python Institute often tests whether candidates notice the trailing space in the string literal `'Hello, '` versus a missing space, and whether they understand that `input()` does not add quotes around the entered value.
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, Alice
The `print('Hello, ' + name)` statement concatenates the string literal `'Hello, '` (which includes a trailing space) with the user input `'Alice'`, producing the output `Hello, Alice`. The `input()` function returns the exact string entered by the user without any extra quotes or formatting.
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,Alice
Why it's wrong here
Incorrect. There should be a space after the comma.
- ✗
Hello, 'Alice'
Why it's wrong here
Incorrect. No quotes around the name.
- ✓
Hello, Alice
Why this is correct
Correct. The string 'Hello, ' is concatenated with 'Alice'.
- ✗
Hello, Alice
Why it's wrong here
Incorrect. The newline is not part of the output string shown; it's added by print() but not visible as characters.
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.