The readonly property NClasses returns the number of detected particle classes. Please note that the class zero is not included in NClasses (the class zero is a special class indicating unclassified data).
Hint:
In order to access the particles currently loaded in the particle editor you can use the pre-declared global variable PEData.