How does a Locomotive Work?

Well, there are two major types of locomotive power, one is going to be diesel, which is self explanatory, and the other is steam: which requires coal and/or a steam source.