The Pentax K mount was introduced in 1975 and has been Pentax’s primary mount for both film and digital SLRs ever since. It has changed a few times to add new features like automatic aperture control and autofocus, but the bayonets underneath are the same. This means all Pentax K lenses will mount on all K mount bodies, including the newest digital cameras.
Pentax K was also widely used by other manufacturers like Ricoh, Cosina, and Chinon, so there is a wide variety of lenses available for the system. M42 lenses can also be adapted quite easily to work on Pentax K bodies.
One of Pentax's most successful cameras, the Pentax K1000, was instrumental in the success of the system. The K1000 is one of the longest-lived 35mm cameras and was produced from 1976 to 1997. It remains one of the go-to recommendations for photography students.
Note: Pentax K mount lenses made by Ricoh have a special “Ricoh pin”. If you want to use these lenses on autofocus Pentax cameras, the pin must be removed. Otherwise it will become locked to the autofocus shaft and removing the lens may require disassembly.