1. Which of the following is a python tuple?

A) [5]

B) {1,2,3}

C) (1,2,3,4)

D) None of the above

Correct Answer: (1,2,3,4)

Explanation : (1,2,3,4) is a python tuple.


2. Which of the following commands will form a list?

A) list=list()

B) list=[]

C) both A and B

D) None of the above

Correct Answer: both A and B

Explanation : list=list(), list=[] is commands will form a list.


3. Which of the following is not true about set ?

A) Mutable data type

B) Does not Allows duplicate values

C) Data type with unordered values

D) Immutable data type

Correct Answer: Immutable data type


4. Char is a valid data type in Python.

A) True

B) False

Correct Answer: False


5. A tuple is a collection of objects that are ordered and immutable.

A) True

B) False

Correct Answer: True

Explanation : A tuple is a collection of objects that are ordered and immutable. - True


6. Which of the following is not a core data type?

A) Lists

B) Tuples

C) Class

D) Dictionary

Correct Answer: Class


7. What is user defined data type in Python?

A) string

B) integer

C) character

D) class

Correct Answer: class


8. The elements of which data structure cannot be changed in Python?

A) List

B) Tuple

C) Set

D) Both b and c

Correct Answer: Tuple

Explanation : Elements of Tuple data structure cannot be changed in Python.


9. In Python, can we create a tuple without round bracket ( )?

A) True

B) False

Correct Answer: True

Explanation : In Python, can we create a tuple without round bracket ( )- True


10. Which syntax does not create a tuple?

A) tpl = (10)

B) tpl = 100,

C) tpl = 100,20,300,

D) tpl = (100,1,200)

Correct Answer: tpl = (10)


11. Which method is used to remove all the items in the dictionary?

A) remove()

B) removeAll()

C) delete()

D) clear()

Correct Answer: clear()

Explanation : The clear() method is used to remove all the items in the dictionary.


12. What does popitem() method return in dictionary?

A) only key

B) only value

C) key and its value

D) -1

Correct Answer: key and its value

Explanation : The popitem() method in dictionary returns the key and its value.


13. To which data structure does the slicing concept apply?

A) dictionary

B) list

C) Set

D) All of the above

Correct Answer: list

Explanation : Slicing concept is applicable to list data structure.


14. What is the default value of step in slicing?

A) -1

B) 0

C) 1-2

D) 1

Correct Answer: 1

Explanation : The default value of step in slicing is 1.


15. In python, when a function returns multiple values, in which data structure are those values ​​stored?

A) dictionary

B) list

C) tuple

D) array

Correct Answer: tuple

Explanation : In python, when a function returns multiple values, those values ​​are stored in the tuple data structure.