Quiz on Python Dictionaries
We all have used dictionaries at some point in our life. But in python, the meaning of the dictionary changes all over. With this Python quiz, we will try to help you gauge your dictionary concepts and understand the complexity associated.
Let us get started. All the best!
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Results
Results
0 of 15 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- Current
- Review / Skip
- Answered
- Correct
- Incorrect
- Question 1 of 15
1. Question
What is the correct declaration to define dictionaries?
CorrectIncorrect - Question 2 of 15
2. Question
In what form is data stored in a dictionary?
CorrectIncorrect - Question 3 of 15
3. Question
What is the time complexity to search any element in a dictionary?
CorrectIncorrect - Question 4 of 15
4. Question
Which of the following is true about dictionaries in python?
CorrectIncorrect - Question 5 of 15
5. Question
Which of the following is a property of keys in the dictionary?
CorrectIncorrect - Question 6 of 15
6. Question
Which of the following variable represents a dictionary element in the following code?
# Code snippet Start
val = ‘QuizOrbit’
valC = {}
valL = [0]*len(val)
for i in val:
if i in valC:
valC[i]+=1
valL[i]+=1
else:
valc[i]=1
valL[i]=1
print(valC)
print(valL)
# Code snippet Start
CorrectIncorrect - Question 7 of 15
7. Question
What will be the output of the following code snippet? # Code snippet Start
empData = {
‘name’:’Vikas’,
‘age’:25,
‘org’: ‘QuizOrbit’,
‘location’: ‘Pune’
}
print(empData.values())
# Code snippet Start
CorrectIncorrect - Question 8 of 15
8. Question
What will be the output of the following code snippet?
# Code snippet StartempData = {
‘name’:’Vikas’,
‘age’:25,
‘org’: ‘QuizOrbit’,
‘location’: ‘Pune’
}empData[‘age’] = 28
empData[‘salary’] = 25000
del empData[‘location’]
empData[‘locData’]= ‘Pune’print(empData[location])
# Code snippet StartCorrectIncorrect - Question 9 of 15
9. Question
What will be the output of the given code snippet?
# Code snippet StartempData = {
‘name’:’Vikas’,
‘age’:25,
‘org’: ‘QuizOrbit’,
‘location’: ‘Pune’
}empData[‘age’] = 28
empData[‘salary’] = 25000
del empData[‘location’]
empData[‘locData’]= ‘Pune’print(empData[‘age’])
# Code snippet StartCorrectIncorrect - Question 10 of 15
10. Question
What will be the output of the given code snippet?
# Code snippet StartsqVal = {x: x*x for x in range(2,12,4)}
print(sqVal)
# Code snippet Start
CorrectIncorrect - Question 11 of 15
11. Question
Find the output of the ode given below?
# Code snippet StartempData = {
‘name’:’Vikas’,
‘age’:25,
‘org’: ‘QuizOrbit’,
‘location’: ‘Pune’
}empData[‘age’] = 28
empData[‘salary’] = 25000
del empData[‘location’]
empData[‘locData’]= ‘Pune’print(len(empData))
# Code snippet Start
CorrectIncorrect - Question 12 of 15
12. Question
What will be the result of the given code after execution?
# Code snippet StartempData = {
‘2’:4,
‘3’:9,
‘1’:1,
‘8’:64,
‘6’:36
}print(sorted(empData)[::-1])
# Code snippet Start
CorrectIncorrect - Question 13 of 15
13. Question
What will be the output of the code given below?
# Code snippet StartempData = {
‘1’:1,
‘8’:64,
‘0’:0,
‘-3’:9,
‘6’:36
}print(any(empData))
# Code snippet Start
CorrectIncorrect - Question 14 of 15
14. Question
What will be the output of the following code snippet?
# Code snippet StartempData = {
‘name’:’Vikas’,
‘age’:25,
‘org’: ‘QuizOrbit’,
‘location’: ‘Pune’
}print(empData.keys())
# Code snippet Start
CorrectIncorrect - Question 15 of 15
15. Question
What will be the output of the following code snippet?
# Code snippet Start
val = ‘QuizOrbit’
valC = {}
for i in val:
if i in valC:
valC[i]+=1
else:
valC[i]=1
print(valC)
# Code snippet Start
CorrectIncorrect
Summary
Dictionary is one of the most important built-in data structures available to us in Python. With this Python quiz, you might have got a clear picture of your understanding of dictionaries. Make sure to drop your queries in the comments if any.
topic is so much clear
thanks vikash sir
I really best teacher in my life !!
Be in such a progression way.