CBSE Class 12 Computer Science Question 31 of 120

Review of Python Basics — Question 5

Back to all questions
5
Question

Question 5

Which of the following statements converts a tuple into a list ?

  1. len(string)
  2. list(tuple)
  3. tup(list)
  4. dict(string)
Answer

list(tuple)

Reason — In Python, the list() constructor function is used to convert iterable objects, such as tuples, into lists. The syntax list(tuple) means that we are passing a tuple as an argument to the list() function, which then creates a new list containing the elements of the tuple.