A

Admin • 833.24K Points
Coach

Q. What does `dict1 |= dict2` do in Python 3.9+?

  • (A) Deletes duplicate keys
  • (B) Updates dict1 with dict2
  • (C) Creates a new dictionary
  • (D) Swaps keys and values

Explanation by: Admin

`|=` is the update operator introduced in Python 3.9 for dictionaries.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.