Question: how pnp transistor works as a switch?
Answer: For a PNP transistor, the Emitter potential must be positive with respect to the Base. Then the transistor operates as a “single-pole single-throw” (SPST) solid state switch. With a zero signal applied to the Base of the transistor it turns “OFF” acting like an open switch and zero collector current flows.