def startsandendswith(main_str, check_str):
    if not main_str:
        return False
words = main_str.split(' ')
return words[0] == words[-1] == check_str
find whether the string starts and ends with the same word