Python Programming - Data Types
Exercise : Data Types - General Questions
- Data Types - General Questions
1.
What is the data type of the following value:
"Hello, World!"
Answer: Option
Explanation:
"Hello, World!"
is a string in Python. Strings are used to represent text data in Python.
2.
Which of the following is a mutable data type?
Answer: Option
Explanation:
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.
3.
Which of the following is a sequence data type?
Answer: Option
Explanation:
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.
4.
What is the data type of the following value:
(1, 2, 3)
Answer: Option
Explanation:
(1, 2, 3)
is a tuple in Python. Tuples are used to group together multiple values into a single immutable container.
5.
What is the data type of the following value:
{"a": 1, "b": 2, "c": 3}
Answer: Option
Explanation:
{"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.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers