How dynamo produce electricity?

describe how a dynamo produces electricity?

when it moves back and fort it produce electricity

The dynamo consists of hollow space which has of 2 magnets, one at the top and other at the bottom. An iron coil is passed through the centre of the dynamo. When this coil rotates, the dynamo produces electricity