Computer Science
Which amongst the following is a mutable data type in Python ?
- int
- string
- tuple
- list
Python Data Handling
1 Like
Answer
list
Reason — The mutable data type in Python from the options given is a list. Lists can be modified after creation, allowing elements to be added, removed, or modified within the list. In contrast, integers (int), strings, and tuples are immutable data types in Python, meaning their values cannot be changed once they are created.
Answered By
3 Likes
Related Questions
Which of the following is not considered a valid identifier in Python ?
- two2
- _main
- hello_rsp1
- 2 hundred
What will be the output of the following code —
print("100 + 200")
?- 300
- 100200
- 100 + 200
- 200
Which of the following statements are not correct?
(A) An element in a dictionary is a combination of key-value pair.
(B) A tuple is a mutable data type.
(C) We can repeat a key in a dictionary.
(D) clear() function is used to delete the dictionary.
- A, B, C
- B, C, D
- B, C, A
- A, B, C, D
Which of the following statements converts a tuple into a list ?
- len(string)
- list(tuple)
- tup(list)
- dict(string)