Answer:
converts mechanical energy into electrical energy by rotating a coil of wire in a magnetic field
Step-by-step explanation:
generator is based on the principle of Electromagnetic Induction given by Faraday's law.
As per above law rate of change in magnetic flux will induce EMF in closed coil.

here we know

so we will have


so in this way if we rotate a coil between magnetic field of strong magnets by using mechanical energy then it will produce electric energy.