Bob Pattern
This is a small exercise in finding a pattern inside a string: the first and last characters matter, but the middle can be anything. Write a function bob_there that takes a string s and looks for a three-character fragment. Return True if there is a pattern b + any character + b anywhere in the string, otherwise return False.
Примеры
Ввод
"abcbob"Вывод
TrueВвод
"b9b"Вывод
TrueВвод
"aaa"Вывод
FalseНужно реализовать
def bob_there(s: str) -> bool:
Теги
strings
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inVisible tests
1
Input
"abcbob"Expected
True2
Input
"b9b"Expected
True3
Input
"aaa"Expected
False4
Input
"bob"Expected
True5
Input
"bxb"Expected
True6
Input
"b b"Expected
TrueFocus radio
Paused · SomaFM · Fluid