Bird
0
0

Which of the following is a syntax error in Python when trying to print "Hello, World!"?

easy📝 Syntax Q3 of 15
Python - Basics and Execution Environment
Which of the following is a syntax error in Python when trying to print "Hello, World!"?
Aprint("Hello, World!")
Bprint('Hello, World!')
Cprint 'Hello, World!'
Dprint("""Hello, World!""")
Step-by-Step Solution
Solution:
  1. Step 1: Review Python print syntax

    Python 3 requires parentheses around the text in print().
  2. Step 2: Identify which option lacks parentheses

    print 'Hello, World!' uses print without parentheses, causing a syntax error.
  3. Final Answer:

    print 'Hello, World!' -> Option C
  4. Quick Check:

    Missing parentheses in print() = syntax error [OK]
Quick Trick: Always use parentheses with print() in Python 3+ [OK]
Common Mistakes:
MISTAKES
  • Omitting parentheses in print
  • Using Python 2 print style
  • Mixing quotes and parentheses incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes