Which of the following is a collection in Python?
2026
Which of the following is a collection in Python?
Answer: D. str — In Python, data types are categorized as scalar or collection types. Integers (int), floats (float), and booleans (bool) are scalar types that store single…
- A.
int
- B.
float
- C.
bool
- D.
str
Attempted by 741 students.
Show answer & explanation
Correct answer: D
In Python, data types are categorized as scalar or collection types. Integers (int), floats (float), and booleans (bool) are scalar types that store single values. Strings (str) are sequences of characters and support iteration, containment checks, and length operations, making them a collection type. Therefore, the string is the correct answer.
Explore the full course: Bihar Stet Paper Ii Computer Science
Loading lesson…