Solve problem "The second occurrence" online - Learn Python 3 - Snakify

Problem «The second occurrence» (Medium)


Statement

Given a string that may or may not contain the letter of interest. Print the index location of the second occurrence of the letter f. If the string contains the letter f only once, then print -1, and if the string does not contain the letter f, then print -2.

In all the problems input the data using input() and print the result using print().



Saved solutions

Tests

Input Correct answer Result
comfort
-1
coffee
3
qwerty
-2
f
-1
oooooooooooooooooof
-1
ff
1
ffffffffffffffff
1
foooooooooooooof
15
oooooooooooooff
14
ofofofofofofofofo
3