SET - 1
1. What is the output of: type((10,))?
a) <class 'int'> b) <class 'list'> c) <class 'tuple'>d) <class 'str'>
2. Tuples are:
a) Mutable b) Immutable c) Changeable d) Dynamic
3. Which method returns the number of times a specified value appears in a tuple?
a) index() b) count() c) find() d) repeat()
4. Which of these operations is not allowed on a tuple?
a) Iteration b) Concatenation c) Slicing d) Item assignment
5. Tuple slicing returns:
a) String b) List c) Tuple d) Dictionary
6. Assertion (A): Tuples are faster than lists for iteration.
Reason (R): Tuples are immutable, so Python can optimize their memory.
A. Both A and R are true, and R is the correct explanation B. A is true, R is false C. A is
false, R is true
D. Both A and R are false
7. Assertion (A): (1, 2, 3).index(2) returns 2.
Reason (R): index() returns the index of the first occurrence.
A. Both A and R are true, and R is the correct explanation B. A is true, R is false C. A is
false, R is true
D. Both A and R are false
8. A. Tuples allow duplicate elements. B. Tuples use parentheses while lists use
square brackets.
A. BOTH true B. A true B false C. A false B True D. Both false
9. A. You can use a tuple as a key in a dictionary. B. (1) is a valid tuple with one
element.
A. BOTH true B. A true B false C. A false B True D. Both false
10.
Column A (Concept) Column B (Example)
A. Immutable 1. t[0]
B. Packing 2. a,b=(1,2)
C. Unpacking 3. t = 1, 2, 3
D. Indexing 4. Tuple cannot be changed after creation
E. Slicing 5. t[1:3]
A. A3 B2 C1 D4 E5 B. A4 B2 C3 D1 E5 C. A3
B2 C1 D 5 E4 D. A4 B3 C2 D1 E5
11. Which method is used to get all the keys from a dictionary?
a) allkeys() b) keys() c) getkeys() d) fetch_keys()
12. Which method removes a key from a dictionary and returns its value?
a) remove() b) pop() c) delete() d) discard()
13. The update() method is used to:
a) Delete keys b) Merge two dictionaries c) Copy keys d) Convert list to dictionary
14. Which one of the following is true for dictionary?
a) Ordered, mutable, allows duplicates b) Unordered, mutable, no duplicates c)
Ordered, immutable
d) Mutable, allows keys to repeat
15. What is the correct way to delete all items in a dictionary?
a) del d b) [Link]() c) [Link]() d) [Link]()
16. Assertion (A): [Link]() returns a list of keys.
Reason (R): In Python 3, it returns a view object, not a list.
A. Both A and R are true, and R is the correct explanation B. A is true, R is false C. A is
false, R is true
D. Both A and R are false
17. Assertion (A): Dictionary is a sequence data type.
Reason (R): It supports indexing.
A. Both A and R are true, and R is the correct explanation B. A is true, R is false C. A is
false, R is true
D. Both A and R are false
18. Assertion (A): You can merge dictionaries using the update() method.
Reason (R): update() overwrites existing keys and adds new ones.
A. Both A and R are true, and R is the correct explanation B. A is true, R is false C. A is
false, R is true
D. Both A and R are false
19. A. The clear() method empties the dictionary. B. Dictionary values can be any type,
including other dictionaries.
A. BOTH true B. A true B false C. A false B True D. Both false
20. Which function gives square root of a number?
a) [Link]() b) [Link]() c) [Link]() d) [Link]()
21. What is [Link] approximately equal to?
a) 3.14 b) 2.72 c) 1.61 d) 1.41
22. What does [Link](16) return?
a) 4 b) 8 c) 256 d) 2
23. A. [Link]() always rounds down. B. [Link]() returns the absolute value as
float.
A. BOTH true B. A true B false C. A false B True D. Both false
24. Assertion (A): [Link]() returns the arithmetic average.
Reason (R): It adds all values and divides by their count.
A. Both A and R are true, and R is the correct explanation B. A is true, R is false C. A is
false, R is true
D. Both A and R are false
25. Assertion (A): [Link](2, 3) is the same as 2 ** 3.
Reason (R): Both calculate exponentiation.
A. Both A and R are true, and R is the correct explanation B. A is true, R is false C. A is
false, R is true
D. Both A and R are false