Explanation:
The correct answers are:
A. "python".index("th")
The index() method is used to find the starting index of a substring within a string.
"python".index("th") returns 2, as the substring "th" starts at index 2 in the string “python".
Example: result = “python".index("th") print(result) # Outputs: 2
D. sorted("python")
The sorted() function returns a new sorted list containing the characters of the string "python" in alphabetical order.
Example: result = sorted("python") print(result) # Outputs: ['h', 'n', 'o', 'p', 't', 'y']
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
flthymcnsty
2 months, 1 week ago