Steam locomotives were the major form of motive power on railroads from the beginning of the railroad age until the middle of the 20th century. In a very few parts of the world they are still in serious use, although they are slated for replacement in most of those places, such as China.
The steam locomotive is an external combustion engine in which some form of heat is applied to water contained in a sealed boiler, turning it into high-pressure steam that forms at the top of the boiler space. This steam is tapped off from the boiler (controlled by a throttle) and passed into some mechanism for converting high-pressure gas into mechanical force. This is conventionally a reciprocating engine in which a piston moves inside a cylinder, but also can be a turbine.