Which of the following is a collection in Python?

2026

Which of the following is a collection in Python?

Answer: D. strIn Python, data types are categorized as scalar or collection types. Integers (int), floats (float), and booleans (bool) are scalar types that store single…

  1. A.

    int

  2. B.

    float

  3. C.

    bool

  4. 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…