A

Admin • 832.52K Points
Coach

Q. What is the output of `dict(zip(['a', 'b'], [1, 2]))`?

  • (A) {'a': 1, 'b': 2}
  • (B) [('a', 1), ('b', 2)]
  • (C) {1: 'a', 2: 'b'}
  • (D) Error

Explanation by: Admin

`zip()` pairs up elements, and `dict()` converts them into key-value pairs.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.