Explanation:
The correct answers are:
B. "python".rindex("th")
The rindex() method finds the last occurrence of a substring in a string and returns its starting index.
If the substring is not found, it raises a ValueError.
Example: result = "python".rindex("th") print(result) # Outputs: 2
D. "python".find("")
The find() method returns the lowest index where the specified substring is found.
An empty string ("") is always considered present in any string, starting at index 0.
Example: result = "python".find("") print(result) # Outputs: 0
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
1 month ago