Both NPN and PNP transistors can be used as switches. Here is more information about different examples for working transistor as a switch.