An electromagnet is made when when current is passed through a coil of
wire wrapped around an iron nail. The nail becomes magnetic and able to
pick up metallic objects.
The principle can be used to create an electric motor motor by forming a
current carrying coil into which is attached a movable core that is attached
to a spring.
Based on the arrangement, when a current flows in the coil, the movable
core, known as the armature, is pulled into the the coil and when the
current is switched off the spring pushes the armature out again.
The mechanical energy of the motion of the armature can be used to put
switches on or off, and to open and close valves.
Learn more here:
https://brainly.com/question/24302872