QuestionQ54

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

Consider this code.

Question Image

Which of the following expressions evaluates to 19?

Explanation

str.find() returns the lowest index at which a substring occurs. The first occurrence of 'an' starts at zero-based index 19, so calling find('an') on the nonempty string returns 19. Python documentation: Built-in Types

Learn more

Community Discussion

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