Bird
0
0

Identify the error in this code:

medium📝 Debug Q6 of 15
Python - Input and Output
Identify the error in this code:
print('Hello' sep=' ' 'World')
AMissing comma between arguments
BInvalid use of sep parameter
CMissing quotes around sep value
DNo error, code is correct
Step-by-Step Solution
Solution:
  1. Step 1: Check syntax of print arguments

    Arguments must be separated by commas. Here, 'Hello' and sep=... are not separated by a comma.
  2. Step 2: Confirm correct syntax for sep parameter

    sep=' ' is valid, but missing comma before it causes syntax error.
  3. Final Answer:

    Missing comma between arguments -> Option A
  4. Quick Check:

    Arguments must be comma-separated [OK]
Quick Trick: Separate print arguments with commas [OK]
Common Mistakes:
MISTAKES
  • Forgetting commas between arguments
  • Misplacing sep parameter
  • Assuming sep can be used without commas

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes