Zed-King Study app · Free
O Level students across India practise here, free
Google login · no Play Store needed
About this PDF
Chapter 5 — questions on lists, tuples, sets and dictionaries, including mutability and the common built-in methods.
This is part of the free O Level M3-R5.1 study material in the Zed-King Study Zone. You can read every page above in your browser, or download the file and study offline. Zed-King Group of Institute is a NIELIT Study Centre in Kaithal, Haryana, and all of this material follows the current NIELIT syllabus.
- Course
- O Level — NIELIT Foundation Diploma
- Module
- M3 — M3-R5.1: Programming and Problem Solving through Python
- Section
- Chapterwise MCQ
- Format
- PDF — read online or download
- Price
- Free, no sign-up required
Text from this PDF
The opening pages as plain text — open the reader above for tables, diagrams and the full file.
Chapter-5 (Sequence Data Types)
Q1. Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are_____ ANS. Tuple, set and dictionary.
Q2. List is________ & Tuple is________. A mutable data type means that a python object of this type can be modified. An immutable object can't.
ANS. Mutable, immutable Immutable object.
ANS. Strings, Tuples, Numbers
Q4. List structure in python where elements are stored in_________.
ANS. [] parenthesis
Q5. Empty list indicated by________.
ANS. [] symbol.
Q6. __________help programmers to create lists in a concise way.
ANS. List Comprehensions
Q7. If list1= [10,20,30], then operation list1*2 returns _________.
Q8. _________function converts a list into tuple.
ANS. Tuples(seq)
Q9. _______function converts a string to a list in python.
ANS. List ()
Q10________ method is used to removes all the items at once. · Ans. Clear ()
Q11.______ Function removes a set’s first and the last elements from a list. · Ans. pop
Q12. List is the _______________ in python.
ANS. collection of different data type
Q13. In python -1 correponds to the ANS. last index
Q14. Negative count from the Right is ANS. L1[-1]
Q15. Assume _____ is the name of list then the last element of list in python ANS. 'bikes’, bikes*;-1]
Q16. Assume l=[1,2,3,4], then 1[-2] value will be _. · Ans. 3
Q17. To add a new element to a list we use ___________ Python command. · Ans. list1.append(5)
Q18. To remove string "hello" from list1, we use ___________ command.
ANS. list1.remove("hello")
Q19. The output when we execute list("hello") is ______.
Q20. Suppose list Example is ['h','e', 'l','l', 'o'], then the value of __________ will be 5.
ANS. len(listExample)
Q21. Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3]. Then list1.count(5) function will return the value ______.
ANS. 2
Q22. Suppose list1 is [1, 5, 9], Then sum(list1) function will return the value ______.
ANS. 15
Q23. Suppose list1 is [3, 4, 5, 20, 5], then list1.index(5) will return _____.
ANS. 2
Q24. ____________ are used in which the ‘in' operator can be used to check if an item is in it.
ANS. Lists, Dictionary and set
Q25. ____ in python is made by following ways:
list =[] //empty list l=list() //empty list l=list([1,2,3])
ANS. list
Q26. If we try to access the item outside the list index, then _________ type of error it may give.
ANS. List index out of range
Q27._________ are valid string manipulation functions in Python.
ANS. Count () upper() strip ()
Q28._________function in string is used to return a string by converting the whole given string into lowercase.
ANS. lower ()
Q29. In Python, a tuple can contain ANS. both integers and strings as its elements
Q30. Tuple can be used as ________ in python.
ANS. dictionary key
31. Each individual character in a string can be accessed using a technique called___.
ANS. indexing
32. Python allows concatenation.
Membership, slicing are all operations on string data type.
ANS.
33. Slicing method is used to access some part of a string or substring.
Q34. _______will return complete string.
ANS. str[:]
Q35. ______ will return empty string.
ANS. str[11:5]
Q36. str[5:11] will return 6 characters.
ANS.
Q37. ______ will return reverse string str1.
ANS. str1[::-1]
Q38. split() function returns the ______ of words delimited by the specified substring.
ANS. List
39. __________ function returns the index value of first occurrence of substring occurring in the given string.
ANS. Index()and find()
40. _____ is used to explicitly remove entire tuple.
ANS. del
Q41.The difference3 between tuples and lists are, the tuples cannot be changed unlike lists and tuples use _______ whereas lists use square brackets.
ANS. parentheses
Q42. A Python tuple that is created without using the parentheses brackets() as ________.
ANS. tuple packing.
Q43. ______ function of dictionary gets all the keys from the dictionary.
ANS. Keys()
Q44. You can obtain a value in a _______ using a key for a single element.
ANS. dictionary
Q45. ____function converts a sequence of tuples to dictionary in python.
ANS. dict(d)
Q46. In order to store values in terms of key and value we use _____ core data type ANS. Dictionary
Q47. _____ is a mapping datatype.
More chapterwise mcq for M3-R5.1
Run these Python programs yourself — free
Reading code is not the same as writing it. Type any program from these notes into our free online Python compiler (real Python 3 with NumPy, input() works), or study one of the explained programs with its output.
Prepare for O Level with expert guidance
Classroom training, practical labs and exam registration at Zed-King Institute, Kaithal.
