Someone please check my solution for FANCY QUOTE question of January Long

The question is marked as CAKEWALK and it indeed is easy, and i wrote a code which checks all the cases, that is not in the beginning, in the end, in middle and not as the only word. Still the judge says wrong answer.

Here is my code : my code

I want to thank you in advance for giving your time and helping me out.