Unit 3: Data Structures in Python
Total points 30/30
Stay Tuned for Daily MCQs for All 6th Semester subs Computer EGG Group
Online Quiz to help you in preparing for Online Exams, It covers Multiple Choice
Questions (MCQs) for 30 Marks
imp Links:
All Theory tutorials: https://bit.ly/335XFKi
contact us on [email protected]
1. Lists are * 1/1
A. Immutable
B. Mutable
C. Both A & B
D. None of the above
2. How to define an empty list * 1/1
A. list[]
B. listname=[ ]
C. listname[]
D. list=()
https://docs.google.com/forms/d/e/1FAIpQLScV3TIKs3YPXeDIMyLsXmBUia4T8AmwGKubdvWtrblNVP4FXw/viewscore?viewscore… 1/10
3. What is the output of list1=[1,2,3] print(list1[1]) * 1/1
A. 2
B. 1
C. 3
D. 0
4. Which python function is used to return length? * 1/1
A. len()
B. length()
C. obj.len
D. none of the mention
5. Does python allow negative indexing? * 1/1
Yes
No
Maybe
https://docs.google.com/forms/d/e/1FAIpQLScV3TIKs3YPXeDIMyLsXmBUia4T8AmwGKubdvWtrblNVP4FXw/viewscore?viewscore… 2/10
6. The Slice operation is performed on a list using * 1/1
A. slice
B. : (colon)
C. .(dot)
D. - (hyphen)
7. What is the output of * 1/1
A. [1, 2, 3, 4, 6]
B. Error
C. None
D. [6,1,2,3,4]
8. What is the output of * 1/1
A. [1, 2, 3, 4, 6]
B. [6, 1, 2, 3, 4]
C. [1, 6, 2, 3, 4]
D. [1, 2, 6, 3, 4]
https://docs.google.com/forms/d/e/1FAIpQLScV3TIKs3YPXeDIMyLsXmBUia4T8AmwGKubdvWtrblNVP4FXw/viewscore?viewscore… 3/10
9. What is the output of * 1/1
A. [1, 2, 3, 4, 5, 6, 7, 8]
B. [1, 2, 6, 3, 4]
C. [5, 6, 7, 8, 1, 2, 3, 4]
D. error
10. What is the output of * 1/1
A. 4
B. [1, 2, 3, 4]
C. 5
D. error
https://docs.google.com/forms/d/e/1FAIpQLScV3TIKs3YPXeDIMyLsXmBUia4T8AmwGKubdvWtrblNVP4FXw/viewscore?viewscore… 4/10
11. We can delete element from the list by using, Select correct 1/1
answers *
A. 'del'
B. remove()
C. pop()
D. clear()
E. All the above
12. What will be the output * 1/1
A. 6
B. error
C. 7
D. [6, 7, 8]
13. The python tuple is _____ in nature. * 1/1
A. Unchangeable
B. Immutable
C. Both A & B
D. Mutable
https://docs.google.com/forms/d/e/1FAIpQLScV3TIKs3YPXeDIMyLsXmBUia4T8AmwGKubdvWtrblNVP4FXw/viewscore?viewscore… 5/10
14. What is the output of * 1/1
A. ('p', 'e', 'd', 'i', 'a')
B. ('i', 'p', 'e', 'd', 'i', 'a')
C. Slicing tuple is not possible
D. error
15. Select the build-in functions of tuple * 1/1
A. count()
B. index()
C. pop()
D. __add__()
E. clear()
16. Does the python set have duplicate elements? * 1/1
Yes
No
Maybe
https://docs.google.com/forms/d/e/1FAIpQLScV3TIKs3YPXeDIMyLsXmBUia4T8AmwGKubdvWtrblNVP4FXw/viewscore?viewscore… 6/10
17. Does the set supports indexing * 1/1
Yes
No
Maybe
18. Is slicing allowed in Set * 1/1
A. allowed
B. not allowed
19. What is the output of * 1/1
A. {1, 2, 3, 4, 5, 6, 7, 8}
B. {1, 2, 3, 4, 5, 4, 5, 6, 7, 8}
C. {1, 2, 3, 4, 4, 5, 6, 7, 8}
D. error
https://docs.google.com/forms/d/e/1FAIpQLScV3TIKs3YPXeDIMyLsXmBUia4T8AmwGKubdvWtrblNVP4FXw/viewscore?viewscore… 7/10
20. Python dictionaries are ______ * 1/1
A. Mutable
B. Immutable
21. What is the output of * 2/2
{'brand': 'Ford', 'model': 'Mustang', 'year': 2018}
{'brand': 'Ford', 'model': 'Mustang', 'year': 1964}
ERROR
22. What is the output of * 2/2
Yes, 'model' is one of the keys in the thisdict dictionary
No output
Error
https://docs.google.com/forms/d/e/1FAIpQLScV3TIKs3YPXeDIMyLsXmBUia4T8AmwGKubdvWtrblNVP4FXw/viewscore?viewscore… 8/10
23. What is the output of * 2/2
error
24. What is the output of * 2/2
{'brand': 'Ford', 'model': 'Mustang', 'year': 1964, 'color': 'red'}
{'brand': 'Ford', 'model': 'Mustang', 'year': 1964}
{'brand': 'Ford', 'model': 'Mustang', 'year': 1964, 'color': '}
error
https://docs.google.com/forms/d/e/1FAIpQLScV3TIKs3YPXeDIMyLsXmBUia4T8AmwGKubdvWtrblNVP4FXw/viewscore?viewscore… 9/10
25. What is the output of * 2/2
name 'thisdict' is not defined
{'brand': 'Ford', 'model': 'Mustang', 'year': 1964, 'color': 'red'}
{'brand': 'Ford', 'model': 'Mustang', 'year': 1964}
Feedback *
cwipedia.in
This content is neither created nor endorsed by Google. - Terms of Service - Privacy Policy
Forms
https://docs.google.com/forms/d/e/1FAIpQLScV3TIKs3YPXeDIMyLsXmBUia4T8AmwGKubdvWtrblNVP4FXw/viewscore?viewscor… 10/10