What is the data type of the following value: {"a": 1, "b": 2, "c": 3}
A:
String
B:
List
C:
Tuple
D:
Dictionary
Answer:D
{"a": 1, "b": 2, "c": 3} is a dictionary in Python. Dictionaries are used to store key-value pairs, where each key maps to a corresponding value.
Discuss About this Question.
What is the data type of the following value: (1, 2, 3)
A:
String
B:
List
C:
Tuple
D:
Dictionary
Answer:C
(1, 2, 3) is a tuple in Python. Tuples are used to group together multiple values into a single immutable container.
Discuss About this Question.
Which of the following is a sequence data type?
A:
Dictionary
B:
Set
C:
Tuple
D:
None of the above
Answer:C
Tuples are a sequence data type in Python, meaning that their elements are ordered and indexed, and they can be accessed by their position in the sequence. Dictionaries and sets are not sequence data types, because they are unordered.
Discuss About this Question.
Which of the following is a mutable data type?
A:
String
B:
Tuple
C:
List
D:
Float
Answer:C
Lists are mutable in Python, meaning that their contents can be changed after they are created. Strings, tuples, and floats are all immutable, meaning that their contents cannot be changed after they are created.
Discuss About this Question.
What is the data type of the following value: "Hello, World!"
A:
String
B:
List
C:
Tuple
D:
Dictionary
Answer:A
"Hello, World!" is a string in Python. Strings are used to represent text data in Python.
Discuss About this Question.
Ad Slot (Above Pagination)
Install ExamAdept
Fast access — add this app to your device.
To install on iPhone/iPad: tap Share → Add to Home Screen.
Discuss About this Question.