Solve problem "The first and last occurrence" online - Learn Python 3 - Snakify

The first and last occurrence


Given a string that may or may not contain a letter of interest. Print the index location of the first and last appearance of f. If the letter f occurs only once, then output its index. If the letter f does not occur, then do not print anything.

Don't use loops in this task.

Advertising by Google, may be based on your interests

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