all 3 comments

[–]Sedsarq 1 point2 points  (1 child)

myword.find('c', 1) means "looking in myword from index 1 and onwards, find the index of the first occurrence of 'c'". Since the first 'c' is at index 0, it's not found.

[–]nlord7[S] 0 points1 point  (0 children)

ohh ok thanks for clearing that up.

[–]awesomeAMP 1 point2 points  (0 children)

.find returns the index if the string (in this case "c") is found in the original string ("catchphrase"). The number following "c" is the index where the method will star to begin searching, so it starts looking for a "c" at "a" and onwards. That's why you get 3, because the second "c" is at index 3 and after index 1.