A

Admin • 825.56K Points
Coach

Q. What will `dict.fromkeys(['a', 'b'], 0)` return?

  • (A) {'a': 0, 'b': 0}
  • (B) {'a': None, 'b': None}
  • (C) {0: 'a', 0: 'b'}
  • (D) ['a', 'b']: 0

Explanation by: Admin
`fromkeys()` creates a new dictionary with given keys and default value.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.