Dictionaries || Type A || Sumita Arora || Class 11 || Information Practices || Solution



Q1. Why is dictionary termed as an unordered collection of objects ?

 

Q2. What type of objects can be used as keys in dictionaries ?

 

Q3. Though tuples are immutable type, yet they cannot always be used as keys in a dictionary. What is the condition to use tuples as a key in a dictionary ?


 

Q5. What all types of values can you store in : (a) dictionary-values ?(b) dictionary-keys ?


Q6. Can you change the order of dictionary's contents, i.e., can you sort the contents of a dictionary ?


Q7. In no more than one sentence, explain the following Python error and how it could arise: Type Error : unhashable type: 'list'



Q8. Can you check for a value inside a dictionary using in operator ?How will you check for a value inside a dictionary using in operator ?


Q9. Dictionary is a mutable type, which means you can modify its contents ?What all is modifiable in a dictionary ?Can you modify the keys of a dictionary ?


Q10. How is del D and del D[<key>] different from one another if D is a dictionary ?


Q11. How is clear( ) function different from del < dict > statement ? 

3 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post