CBSE Class 12 Computer Science Question 44 of 120

Review of Python Basics — Question 18

Back to all questions
18
Question

Question 18

Identify the valid declaration of L:

L = {1: 'Mon', 2 : '23', 3: 'hello', 4: '60.5'}
  1. dictionary
  2. string
  3. tuple
  4. list
Answer

dictionary

Reason — The given declaration L = {1: 'Mon', 2: '23', 3: 'hello', 4: '60.5'} creates a dictionary in Python. Dictionaries are created using curly braces {}, and keys are separated from their corresponding values by a colon (:). Each key-value pair is separated by a comma (,) within the dictionary.