Question 3.
We initialized P= False and Q=False initially
If (X.parts of speech== Pronoun and Q.)
here in the above condition if Q is false it won't get executed.
Every Word ending with Full stop will go to last if loop and returns the Q=False.
So Every sentence beginning with pronoun will won,t get executed as Q=False for first word in the sentence.
And for all the other conditions other than the first word in the sentence the Q will be True.
Question 4,
P will be only True when the before word is Noun .
If it is noun and P=True then only the C count will be increased otherwise it won't get executed.
Example
So if there are consecutive nouns It Was Monday morning.
Monday is noun , It will enter in IF loop of Noun and as before word is verb P will be false so 'C' count wont get increased.
Morning is Noun, It will enter In If loop of Noun and as before word is noun P will be True So 'C' count will get increased.
Remember for condition will check True or false and even we can assign some variables as True or False
Example : If (A>30) true then only we enter that loop if A=10 then we can't enter that loop as 10<30 is False . If A=40 then we will enter the as 40>30 is True.
Hope it helps you