QuestionQ27

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

Which of the following calls are valid?

Choose two
  • A sort("python")
  • B "python".find("")
  • C "python".sort()
  • D sorted("python")
Explanation

String objects support find, including with an empty string argument. The built-in sorted function accepts strings as iterables and returns a list of sorted characters.

Community Discussion

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