A solenoid is a long coil of wire. When a current flows, every turn of wire has its own magnetic field, and inside the coil these fields add together. The result is a strong, uniform field inside the coil. Outside, the field looks like the field of a bar magnet, with a north pole at one end and a south pole at the other. Plotting compasses placed around the coil show this pattern, and reversing the current swaps the poles.
The magnetic effect can be made stronger by increasing the current, by adding more turns of wire, or by winding the turns closely together so that they take up a shorter length. Putting an iron core inside the coil also makes the field much stronger. Iron is a magnetic material, so the core becomes an induced magnet and its own field adds to the field of the coil.
A solenoid with an iron core is an electromagnet. Unlike a permanent magnet, it can be switched off by stopping the current. To investigate, a student changes one factor at a time, such as the number of turns, keeps the current the same, and counts how many paperclips the coil picks up.