Bird
0
0

What is wrong with this Ruby comment?

medium📝 Debug Q7 of 15
Ruby - Basics and Runtime
What is wrong with this Ruby comment?
#This is a comment without space
ANo error, this is valid Ruby comment
BComments must start with //
CComments must have a space after #
DComments cannot be on a single line
Step-by-Step Solution
Solution:
  1. Step 1: Understand Ruby comment rules

    Ruby allows comments starting with # with or without space after it.
  2. Step 2: Verify comment validity

    The comment is valid even without a space after #.
  3. Final Answer:

    No error, this is valid Ruby comment -> Option A
  4. Quick Check:

    Space after # is optional in Ruby comments [OK]
Quick Trick: Space after # in comments is optional [OK]
Common Mistakes:
MISTAKES
  • Thinking space is required
  • Using // for comments
  • Believing comments must be multi-line

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes