A

Admin • 828.70K Points
Coach

Q. Which of the following is the correct way to define a dictionary?

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

Explanation by: Admin
Dictionaries are defined using curly braces `{}` with key-value pairs separated by colons.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.