Bird
0
0

Which of the following is the correct way to write a multi-line comment in Python?

easy📝 Syntax Q12 of 15
Python - Basics and Execution Environment
Which of the following is the correct way to write a multi-line comment in Python?
A<!-- This is a multi-line comment -->
B'''This is a multi-line comment'''
C// This is a multi-line comment //
D/* This is a multi-line comment */
Step-by-Step Solution
Solution:
  1. Step 1: Recognize Python multi-line comment style

    Python uses triple single quotes ''' or triple double quotes """ for multi-line comments or docstrings.
  2. Step 2: Eliminate other language comment styles

    Options A, B, and D are comment styles from other languages like HTML, JavaScript/C++, and C.
  3. Final Answer:

    '''This is a multi-line comment''' -> Option B
  4. Quick Check:

    Multi-line comment = triple quotes [OK]
Quick Trick: Use triple quotes ''' or """ for multi-line comments [OK]
Common Mistakes:
MISTAKES
  • Using // or /* */ which are not Python syntax
  • Using HTML style comments
  • Trying to use # for multi-line comments without repeating

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes