Certified Associate in Python Programming (PCAP) — Question 121

Which of the following invocations are valid? (Choose two.)

Answer options

Correct answer: B, C

Explanation

The correct answers are B and C because both find() and rindex() are valid methods for string objects in Python, allowing for search functionality. Option A is incorrect as sort() is not a method associated with strings, and option D is wrong since the sorted() function cannot be called as a method on a string object.