bob_there

Requirements:

  • access a single character

  • if, else

  • loop through a string (while)

Output True if the inputted string contains a "bob" string, but where the middle 'o' character can be any character.

This exercise was taken from codingbat.com and has been adapted for the Python language. There are many great programming exercises there, but the majority are created for Java.

Test 1

Input:

'abcbob'

Output:

True

Test 2

Input:

'b9b'

Output:

True

Test 3

Input:

'bac'

Output:

False

Test 4

Input:

'bbb'

Output:

True

Test 5

Input:

'abcdefb'

Output:

False

Test 6

Input:

'123abcbcdbabxyz'

Output:

True

Test 7

Input:

'b12'

Output:

False

Test 8

Input:

'b1b'

Output:

True

Test 9

Input:

'b12b1b'

Output:

True

Test 10

Input:

'bbc'

Output:

False

Test 11

Input:

'bbb'

Output:

True

Test 12

Input:

'bb'

Output:

False

Test 13

Input:

'b'

Output:

False