Above the dir(p) the sentence started with If and never ended so 'Y' should be 'y'.