Unblocked XYZ
In strings, you may need to find a marker but ignore it when a special character comes right before it. Write a function xyz_there that checks whether the string s contains the substring xyz. Return True only if the found xyz is not directly preceded by a period.
Примеры
Ввод
"abcxyz"Вывод
TrueВвод
"abc.xyz"Вывод
FalseВвод
"xyz.abc"Вывод
TrueНужно реализовать
def xyz_there(s: str) -> bool:
Теги
strings
Kirjaudu sisään nähdäksesi palautushistorian
Kirjaudu sisäänKirjaudu sisään käyttääksesi tekoälymentoria
Kirjaudu sisäänVisible tests
1
Input
"abcxyz"Expected
True2
Input
"abc.xyz"Expected
False3
Input
"xyz.abc"Expected
True4
Input
"abcxyz.xyz"Expected
True5
Input
".xyz"Expected
False6
Input
"12.xyz"Expected
FalseFocus radio
Paused · SomaFM · Fluid