QuestionQ122

VerifiedMiscellaneous (List Comprehensions, Lambdas, Closures, I/O)

Which of the following invocations are valid?

Choose two
Explanation

str.index() is a valid method for finding a substring within a string. sorted() accepts a string as an iterable and returns a list containing its characters in sorted order. rfind is not a standalone built-in function, and strings do not provide a sort() method.

Community Discussion

No comments yet. Be the first to start the discussion!