Computer Science
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
Python Dictionaries
3 Likes
Answer
B, C, D
Reason —
(B) Tuples are immutable data types in Python, meaning their values cannot be changed after creation.
(C) Dictionary keys must be unique, we cannot repeat a key in a dictionary.
(D) The clear() function is used to remove all elements from a dictionary, not to delete the dictionary itself.
Answered By
3 Likes
Related Questions
What will be the output of the following code —
print("100 + 200")
?- 300
- 100200
- 100 + 200
- 200
Which amongst the following is a mutable data type in Python ?
- int
- string
- tuple
- list
Which of the following statements converts a tuple into a list ?
- len(string)
- list(tuple)
- tup(list)
- dict(string)
The statement: bval = str1 > str2 shall return …………… as the output if two strings str1 and str2 contains "Delhi" and "New Delhi".
- True
- Delhi
- New Delhi
- False