A

Admin • 825.56K Points
Coach

Q. Which is a correct way to merge two dictionaries `d1` and `d2` in Python 3.9+?

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

Explanation by: Admin
The `|=` operator merges two dictionaries in Python 3.9 and later.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.