PCEP Practice Question: Data Types, Variables, Basic I/O and Operators
Which TWO of the following are valid ways to comment in Python?
⚠ Common exam trap
Python Institute often tests the distinction between Python's comment syntax and comment styles from other languages (e.g., //, /* */) to catch candidates who are familiar with C-family languages but new to Python.
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
✓
# This is a comment
The hash symbol (#) is the standard syntax for single-line comments in Python. Everything after # on that line is ignored by the Python interpreter, making it a valid comment.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
$ This is a comment
Why it's wrong here
Invalid character.
- ✓
# This is a comment
Why this is correct
Standard single-line comment.
- ✗
/* This is a comment */
Why it's wrong here
Block comment syntax from C, not Python.
- ✗
// This is a comment
Why it's wrong here
// is used in C++, not Python.
- ✓
''' This is a comment '''
Why this is correct
Triple-quoted string not assigned acts as a comment.
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.