Dictionaries Informatics Practices Exam Questions

Exam Questions Class 11

Please refer to Dictionaries Class 11 Informatics Practices Exam Questions provided below. These questions and answers for Class 11 Informatics Practices have been designed based on the past trend of questions and important topics in your class 11 Informatics Practices books. You should go through all Class 11 Informatics Practices Important Questions provided by our teachers which will help you to get more marks in upcoming exams.

Class 11 Informatics Practices Exam Questions Dictionaries

Class 11 Informatics Practices students should read and understand the important questions and answers provided below for Dictionaries which will help them to understand all important and difficult topics.

Very Short Answer Type Questions

Q.1 Why can’t List can be used as keys?
Ans:
List is mutable datatype. And Keys of dictionary must be immutable type. This is the region that list cannot be used as keys.

Q.2 What type of objects can be used as keys in dictionary?
Ans:
Any immutable objects can be used as keys in dictionary.

Q.3 Can you change the order of the dictionaries contents?
Ans:
Yes, the order of dictionary contents may be changed.

Q.4 Can you modify the keys in a dictionary?
Ans:
Keys cannot be modified in dictionary while values are mutable in dictionary.

Q.5 Can you modify the value in a dictionary?
Ans:
Yes, Values can be modified in dictionaries.

Q.6 Is dictionary Mutable? Why?
Ans:
Dictionary is mutable type because we can change its values.

Short Answer Type Questions

Q.1 How are dictionaries different from Lists?
Ans:
The dictionary is similar to lists in the sense that it is also a collection of data-items but it is different from lists in the sense that lists are sequential collections(ordered) and dictionaries are non-sequential collections(unordered).
Elements in lists or tuples can be accessed by using indexes. But in dictionaries the values can be obtained using keys. By changing the sequence of key we can shuffle the order of elements of dictionary while this thing is not possible in list.

Q.2 When are dictionaries more useful than lists?
Ans:
Dictionaries can be much more useful than lists when we wanted to store all our friends cell-phone numbers. We could create a list of pairs,(name of friend, phone number), but once this list becomes long enough searching this list for a specific phone number will get-time consuming. Better would be if we could index the list by our friend‟s name. This is precisely what a dictionary does.

Q.3 Discuss the utility and significance of Dictionaries.
Ans:
Dictionaries can be much more useful than lists when we wanted to store all our friends cell-phone numbers. We could create a list of pairs,(name of friend, phone number), but once this list becomes long enough searching this list for a specific phone number will get-time consuming. Better would be if we could index the list by our friend‟s name. This is precisely what a dictionary does.

Q.4 Why is a dictionary termed as an unordered collection of objects?
Ans:
But in dictionaries the values can be obtained using keys. By changing the sequence of key we can shuffle the order of elements of dictionary while this thing is not possible in list. In dictionaries there is no index. It uses its keys as index which can be rearranged. That’s why a dictionary termed as an unordered collection of objects

Q.5 How is clear() function different from del Statement?
Ans:
clear() removes all the elements of a dictionary and makes it empty dictionary while del statement removes the complete dictionary as an object. After del statement with a dictionary name, that dictionary object no longer exists, not even empty dictionary.

Q.6 What is the output produced by the following code –

Dictionaries Informatics Practices Exam Questions

Skill Based Questions


Q.1 WAP that repeatedly asks the user to enter product names and prices. Store all of them in a dictionary whose keys are product names and values are prices. And also write a code to search an item from the dictionary.
Ans:

Dictionaries Informatics Practices Exam Questions

Q.2 WAP to create a dictionary named year whose keys are month names and values are their corresponding number of days.
Ans:

Dictionaries Informatics Practices Exam Questions
Dictionaries Informatics Practices Exam Questions

We hope you liked the above provided Dictionaries Class 11 Informatics Practices Exam Questions. If you have any further questions please put them in the comments section below so that our teachers can provide you an answer.