Question: 17. Two string methods find where a character is in a string: find and index. (a) Both work the same if a character is
17. Two string methods find where a character is in a string: find and index. (a) Both work the same if a character is found, but behave differently if the character is not found. Describe the difference in how they behave when the character is not found. (b) The find and index methods are not limited to finding single characters. They can search for substrings. Given s= "Topkapi", what does s. find ("kap") print? Describe the rule for what find prints.
Step by Step Solution
3.42 Rating (146 Votes )
There are 3 Steps involved in it
a The find method returns the lowest index in the string where the ... View full answer
Get step-by-step solutions from verified subject matter experts
