QuestionQ122Verified/Miscellaneous (List Comprehensions, Lambdas, Closures, I/O)Copy linkReport a problemAsk AstroTutorSave questionWhich of the following invocations are valid?Choose twoA"python".index("th")Brfind("python","r")C"python".sort()Dsorted("python")Show AnswerAnswerExplanationstr.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.Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion