Python Programming - Data Types

Exercise : Data Types - General Questions
  • Data Types - General Questions
21.
Which of the following data types is used to represent a single, immutable element?
List
Tuple
Set
Dictionary
Answer: Option
Explanation:
Tuples are used to represent a single, immutable element in Python. They are similar to lists, but tuples cannot be modified once they are created.

22.
Which of the following data types is used to represent a collection of elements in a specific order with duplicates allowed and with the ability to add or remove elements?
List
Tuple
Set
Dictionary
Answer: Option
Explanation:
Lists are used to represent a collection of elements in a specific order with duplicates allowed and with the ability to add or remove elements.

23.
Which of the following data types is used to represent a group of related elements that can be accessed using a single variable?
List
Tuple
Set
Dictionary
Answer: Option
Explanation:
Dictionaries are used to represent a group of related elements that can be accessed using a single variable. Each element is accessed using a unique key that identifies it within the dictionary.

24.
Which of the following data types is used to represent a sequence of Unicode characters?
int
float
str
bool
Answer: Option
Explanation:
The str data type is used to represent a sequence of Unicode characters, such as a string of text.

25.
Which of the following data types is used to represent a sequence of Unicode characters that can be modified?
int
float
str
bytearray
Answer: Option
Explanation:
The bytearray data type is used to represent a sequence of Unicode characters that can be modified. It is similar to the bytes data type, but it can be modified.