What does `[1, 2, 3] + [4, 5]` produce?

Python Developer Easy

Python Developer — Easy

What does `[1, 2, 3] + [4, 5]` produce?

Key points

  • The `+` operator concatenates lists in Python.
  • The resulting list contains all elements from both original lists.
  • This is different from mathematical addition.
  • The correct answer is a single list, not a nested list.

Ready to go further?

Related questions