KnowledgeBoat Logo

Computer Science

Identify the valid declaration of L:

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

Python Dictionaries

3 Likes

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.

Answered By

1 Like


Related Questions