Question 491 of 498
PCEP Practice Question: Data Types, Variables, Basic I/O and Operators
Which of the following is a valid Python variable name?
⚠ Common exam trap
Python Institute often tests the rule that hyphens are invalid in variable names (confusing them with underscores) and that keywords like 'for' cannot be used as identifiers, leading candidates to mistakenly choose options that look familiar from other languages.
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
✓
_data2
(_data2) is correct because Python variable names must start with a letter or an underscore, and can contain letters, digits, and underscores. _data2 begins with an underscore followed by valid characters, making it a legal identifier.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
my-var
Why it's wrong here
Hyphen is not allowed.
- ✗
for
Why it's wrong here
for is a reserved keyword.
- ✓
_data2
Why this is correct
Starts with underscore, valid.
- ✗
2nd_value
Why it's wrong here
Variable names cannot start with a digit.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 30, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.