Important QnA Python Dictionary class11 contains questions related to the topic dictionary in python for class 11. As we have already covered the basics of the dictionary in the previous article. So let us see questions based on this topic. Let’s Start!
Topics Covered
Important QnA Python Dictionary class11
So let’s start the article Important QnA Python Dictionary class11 with Objective types questions. In this section we will provides you some fill in the blanks, True/False, MCQ based questions with their solutions.
- The ___________ refers to a bunch of values in a single variable. (Ans. Collection)
- The ____________ is unordered collections with elements in the form of a key:value pairs. (Ans. dictionary)
- Dictionaries are mutable. (True/False)
- The key can be considered as an index into the dictionary. (True/False)
- Which of the brackets are used to define the dictionary?
- Round Bracket ()
- Square Bracket []
- Curly Bracket {}
- Angular Bracket <>
- The key and value is separated by ___________ symbol in the dictionary.
- Comma ,
- Semi-Colon ;
- Dash –
- Colon :
- The dictionary key can be mutable types. (True/False)
- Which of the following is the correct statement to access the value of an element of dictionary through key?
- <dictionary> [<key>]
- <dictionary> <key>
- <dictionary>.<key>
- <dictionary>-<key>
- A dictionary operation accepts the key and returns the associated element value is called _________. (Ans. Lookup)
- What happens when the user is trying to access a that doesn’t exist?
- Return None
- Return Garbage Value
- Return Last Value
- Return Error
- Tuple can be used as a key in the dictionary. (True/False)
- The _________ method returns all the keys defined in the dictionary in form of a list. (Ans. keys())
- The _________ method returns all the keys defined in the dictionary in form of a list. (Ans. values())
- Linking with a key and associated value by an internal algorithm is known as ______________.
- Algorithm
- Join
- Hash-function
- Link
- The keys and values both must be unique for the dictionaries. (True/False)
- The in and not in operator will check the presence of keys only, not the value. (True/False)
- The statements <dictionary>.get(<key>) and <dictionary>[<key>] are similar. (True/False)
- Which of the following method will add a key to the dictionary if it does not already exist in the dictionary?
- insert()
- fromkeys()
- update()
- setdefault()
- Which of the method is used to create a new dictionary from a sequence with all the keys and a common value?
- insert()
- fromkeys()
- update()
- setdefault()
- Which of the following is method removes and returns a key:value pair that follows LIFO order?
- pop()
- remove()
- popitem()
- delete()
- Which of the following copy option copies the upper layer whereas the inner referenced object is not copied.
- Shallow copy
- Deep Copy
- Key copy
- partial copy
- What is the output of this code: d ={‘Ind’:’Virat Kohli’,’MS Dhoni’:’Ind’,’NZ’:’Kane Williamson’};print(d[‘Ind’])
- Virat Kohli
- MS Dhoni
- Ind
- All of these
- What is the output of this code:d={‘Virat Kohli’:1,’Steve Smith’:2,’Babar Azam’:3,’Faf Du Plesis’:4};print(d[3])
- ‘Babar Azam’:3
- ‘Faf Du Plesis’:4
- Babar Azam
- Error
- The sorted() function cannot work with a dictionary. (True/False)
- A dictionary can have repeated keys. (True/False)
In the next section of QnA Python Dictionary class11, we will see some subjective type questions:
Subjective type questions
Important QnA Python Dictionary class11 subjective types questions are as following:
- What do you mean by a dictionary? Explain with the context of key:value pair?
- What are the characteristics of a dictionary that differs it from other collections like lists, tuples, sets of python?
- Why dictionaries are considered as associative arrays or mappings or hashes?
- How to traverse a dictionary using loops?
- How you can access keys and values simultaneously? Explain with the example.
- What are the different ways to create a dictionary? Elaborate your answer with an example.
- How to add, update and delete element from the dictionary? Illustrate your answer with an example.
- How to access items, keys and values from a dictionary? Describe the answer with an example.
- How make a copy of a dictionary? Explain all methods with example.
- Which aggregate functions can be used with dictionaries? Write your answer with suitable examples.
I hope you have enjoyed this article QnA Python Dictionary class11. Visit this page QnA Python Dictionary class11 regularly , more questions will be added.
Thank you for reading this article QnA Python Dictionary class11. If you have anything for me, you are welcome in the comment section. Share your valuable feedback, suggestions, loveable comments as a token of love in the comment section.
Follow the below given links for the same category: