Bird
0
0

What will this Python code output?

medium📝 Predict Output Q5 of 15
Python - Basics and Execution Environment
What will this Python code output?
print('Hello' + ' ' + 'World')
AHello World
BHello + World
CHello+ World
DHelloWorld
Step-by-Step Solution
Solution:
  1. Step 1: Understand string concatenation

    The + operator joins strings exactly as written.
  2. Step 2: Analyze the code

    'Hello' + ' ' + 'World' joins with a space between words.
  3. Final Answer:

    Hello World -> Option A
  4. Quick Check:

    String concatenation adds spaces if included [OK]
Quick Trick: Use + to join strings exactly as typed [OK]
Common Mistakes:
MISTAKES
  • Missing spaces between words
  • Expecting + signs in output

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes