Find and Count
Completed
Read a sentence and then a single letter. Print how many times the letter appears, and the index of its first occurrence (or -1 if it isn't there).
Input
Line 1: the sentence. Line 2: one character.
Output
Two lines: count, then index.
Example
Input
banana bread a
Output
4 1
Editor
Python
Hints
s.count(x) counts non-overlapping occurrences.
s.find(x) returns -1 when x is missing (s.index(x) would raise an error).
Solution explanation
find is the safe way to search; index raises ValueError if not found.
Show solution
text = input()
ch = input()
print(text.count(ch))
print(text.find(ch))