Courseiva
Question 183 of 498
Data Types, Variables, Basic I/O and OperatorsmediumMultiple SelectObjective-mapped

PCEP Practice Question: Data Types, Variables, Basic I/O and Operators

Which TWO of the following are valid Python variable names?

⚠ Common exam trap

Python Institute often tests the misconception that special characters like '$' or hyphens are allowed in variable names, or that names can start with digits, confusing Python's rules with those of other languages like JavaScript or shell scripting.

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

_name

Python variable names must start with a letter or an underscore, and '_name' begins with an underscore, which is allowed. The rest of the name consists of letters and underscores, making it a valid identifier per Python's naming rules.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • _name

    Why this is correct

    Valid. Starts with underscore.

  • 2name

    Why it's wrong here

    Invalid. Starts with a digit.

  • name$

    Why it's wrong here

    Invalid. Contains dollar sign.

  • name-2

    Why it's wrong here

    Invalid. Contains hyphen.

  • name_2

    Why this is correct

    Valid. Contains letters, underscore, and 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 →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 30, 2026

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.

Loading comments…

Sign in to join the discussion.

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.