Write a function that finds and removes the second occurrence of a given string in a passed string.

Note: An answer could make use of a variety of techniques (such as looping through the string in some way), but the easiest way is to make use of the find method and making a substring.


```
def secondIndex(passedString, givenString):
index = passedString.find(givenString)
return passedString.find(givenString, index+1)
```

Computer Science & Information Technology

You might also like to view...

Answer the following statements true (T) or false (F)

1. Any if-else-if statement can alternatively be coded as a nested if-else statement. 2. A series of deeply nested if-else statements is usually easier to follow than the logic of an if-else-if statement. 3. In order for an && expression to be true, only the expression on one side of the && operator needs to be true. 4. For an || expression to be true, the expression on the left side of the || operator must be false. 5. If the expression on the left side of the || operator is true, the expression on the right side is not checked.

Computer Science & Information Technology

All Access objects display in the ________ Pane

A) Database B) Access C) Object D) Navigation

Computer Science & Information Technology

If you ________ your work before printing you can save paper by discovering and correcting layout problems before you print

A) preview B) delete C) copy D) save

Computer Science & Information Technology

A ________ shape is composed of both curved and straight-line segments

A) selection net B) flow chart C) vector graphic D) freeform

Computer Science & Information Technology