Bird
0
0

What is the recommended way to temporarily disable multiple lines of code in Python?

hard📝 Application Q8 of 15
Python - Basics and Execution Environment
What is the recommended way to temporarily disable multiple lines of code in Python?
AEnclose the code block within /* and */
BAdd # at the start of each line to comment them out
CWrap the code block inside <!-- and -->
DUse triple quotes to enclose the code block
Step-by-Step Solution
Solution:
  1. Step 1: Understand disabling code

    Python does not support block comments like /* */ or .
  2. Step 2: Evaluate triple quotes

    Triple quotes create multi-line strings but do not disable code execution reliably.
  3. Step 3: Use # for each line

    Adding # at the start of each line is the standard way to disable multiple lines temporarily.
  4. Final Answer:

    Add # at the start of each line -> Option B
  5. Quick Check:

    Use # per line to comment out code blocks [OK]
Quick Trick: Use # on each line to disable code temporarily [OK]
Common Mistakes:
MISTAKES
  • Using /* */ which is invalid in Python
  • Assuming triple quotes disable code

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes