A coil through which an electric current flows generates a magnetic field $$B$$ which is homogeneous inside the coil. Outside, the magnetic field runs (inhomogeneously) from one end of the coil to the other, i.e. from the north to the south pole.