Question

    What is the difference between a list and a tuple in

    Python?
    A A list is mutable, while a tuple is immutable Correct Answer Incorrect Answer
    B A list is immutable, while a tuple is mutable Correct Answer Incorrect Answer
    C A list can only contain strings, while a tuple can contain any data type Correct Answer Incorrect Answer
    D A list can only contain integers, while a tuple can contain any data type Correct Answer Incorrect Answer
    E A list and a tuple are the same thing Correct Answer Incorrect Answer

    Solution

    Explanation: Lists are mutable, meaning that their contents can be modified after they are created. Tuples, on the other hand, are immutable, meaning that their contents cannot be modified after they are created.

    Practice Next