PCEP Computer Programming and Python Fundamentals Practice Question
Exhibit
Refer to the exhibit.
# Python script: convert.py
x = input('Enter number: ')
y = x * 2
print(y)
--- End of exhibit ---Consider the following code:
x = input('Enter a number: ')
print(x + x)
A user enters 5 at the prompt. What is printed?
⚠ Common exam trap
The PCEP exam often tests the distinction between string concatenation and numeric addition, exploiting the fact that `input()` returns a string, so candidates mistakenly assume automatic type conversion to integer.
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
✓
55
55 because Python's input() function returns a string. When the user enters 5, it is stored as the string '5'. If the code then uses the + operator to concatenate this string with itself (e.g., print(input() + input()) or print(x + x)), the result is '55', not numeric addition.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
55
Why this is correct
String '5' repeated twice.
- ✗
10
Why it's wrong here
Input is string, not integer.
- ✗
5
Why it's wrong here
Multiplication occurs.
- ✗
25
Why it's wrong here
String multiplication repeats, not squares.
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.