Bird
0
0

You entered this in IRB:

medium📝 Debug Q6 of 15
Ruby - Basics and Runtime
You entered this in IRB:
puts "Welcome

and received a syntax error. What caused it?
AUsing puts instead of print
BMissing closing double quote
CIncorrect indentation
DMissing parentheses around string
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the code

    The string starts with a double quote but does not have a closing double quote.
  2. Step 2: Understand the error

    Ruby expects matching quotes for strings; missing the closing quote causes a syntax error.
  3. Final Answer:

    Missing closing double quote -> Option B
  4. Quick Check:

    Check for matching quotes in strings [OK]
Quick Trick: Always close your string quotes to avoid syntax errors [OK]
Common Mistakes:
MISTAKES
  • Forgetting to close string quotes
  • Assuming indentation causes syntax error here
  • Thinking parentheses are required for puts

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes