A

Admin • 833.24K Points
Coach

Q. Which method merges two dictionaries without modifying the originals (Python 3.9+)?

  • (A) d1 + d2
  • (B) merge(d1, d2)
  • (C) d1 | d2
  • (D) d1.append(d2)

Explanation by: Admin

The `|` operator returns a new dictionary with merged key-value pairs.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.