Week 3 Unit 5: Self-test

05. December 2024

Question 1

Which of the following statements about functions and methods for complex data types are correct?

Note: There are 3 correct answers to this question.


The method ".count()" can be used for tuples, lists, and dictionaries.
The method ".sort()" cannot be used for tuples, because tuples are immutable.
The function "len()" can be used for tuples, lists, and dictionaries.
"del" cannot be used for items of a tuple, because tuples are immutable.
You cannot use the method ".append()" for dictionaries, because dictionaries are immutable.

< Previous unit | Next unit > | Course Overview