Question: Find the End Position As the fourth test case shows, we have to handle inputs where the commas are in different positions. Right now, we

Find the End Position
As the fourth test case shows, we have to handle inputs where the commas are in different positions. Right now, we will just worry about the case in which the second comma is in a different position. This will allow us to pass the fourth and fifth test cases in the test script.
Find the variable that is tracking the position of the second comma (the one that is assigned to 13). You want to replace the right hand statement with an expression that locates the position of the second comma. To do that, you want to search the string after the position of the first comma. Look at the documentation of find_str in the IntroCS API. If variable first contains the position of the first comma, then what position should you start searching at?
This time you should notice that you do not need to add any new variables. You already have a variable s for the string you are searching. You also have a variable for the position of the first comma. This is all you need to call find_str. Make this change and run the test script. You should now pass the first six tests. There are only two more tests left to go.
Check the Function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!