I am practicing my python coding on this website. This is the problem
Return True if the given string contains an appearance of "xyz" where the xyz is
not directly preceeded by a period (.). So "xxyz" counts but "x.xyz" does not.
xyz_there('abcxyz') → True
xyz_there('abc.xyz') → False
xyz_there('xyz.abc') → True
This is my code , for some unknown reason , i dont pass all the testcases. I have problems debugging it
def xyz_there(str):
counter = str.count(".xyz")
if ( counter > 0 ):
return False
else:
return True