How steam engine works?

How steam engine(locomotive) works?what is the basic principle?
8 answers 8