Skip to content
Question 84 of 97

Q.Write a Python statement to declare a Dictionary named ClassRoll with Keys as 1, 2, 3 and corresponding values as 'Reena', 'Rakesh', 'Zareen' respectively.

Tripura TbseCBSE Class XII Board 2020Subjective· 1mImportance★★★★★
87% · 84/97 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

A dictionary in Python is declared using curly braces with key-value pairs separated by colons; ClassRoll = {1: 'Reena', 2: 'Rakesh', 3: 'Zareen'} creates the required structure.

Dictionaries are one of Python's most powerful built-in data structures, designed to store data as key-value pairs rather than in a simple sequence. Think of them as a real-world dictionary where you look up a word (the key) to find its meaning (the value), or in this case, a roll number to find a student's name.

The syntax is straightforward. You enclose the entire collection in curly braces {}, and inside, each key is linked to its value with a colon :. Multiple pairs are separated by commas. The keys here are integers (1, 2, 3) representing roll numbers, and the values are strings ('Reena', 'Rakesh', 'Zareen') representing student names.

Here's the complete statement:

ClassRoll = {1: 'Reena', 2: 'Rakesh', 3: 'Zareen'}
``` …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.