Write a programBasic10 XPExercise 4/16

Finding a character

Task

The program reads a string and then one character to look for in it (each on its own line).

It prints True if the character occurs in the string, otherwise False, and on the next line how many times it occurs. Upper- and lower-case letters are different characters.

Examples

  • Input

    programovanie
    o

    Expected output

    True
    2

After you submit, 4 hidden tests will also check your solution: several occurrences, the character is missing, upper and lower case, a digit.

Python starts the first time you run code.

Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.

Input (stdin)

Each line = one call to input().

Output

Hints

Try it yourself first. Each hint reveals a little more - and lowers the reward a little.

Signed out, hints are free - but no XP is awarded either.

Solution

The solution unlocks after the last hint.